L L4D2node

L4D1SurvivorMinigunAttack::Update

0x00924c70 · 421 bytes · __thiscall

_ZN25L4D1SurvivorMinigunAttack6UpdateEP11SurvivorBotf

Decompiled

undefined (3 params)

/* L4D1SurvivorMinigunAttack::Update(SurvivorBot*, float) */

L4D1SurvivorMinigunAttack * __thiscall
L4D1SurvivorMinigunAttack::Update
          (L4D1SurvivorMinigunAttack *this,SurvivorBot *param_1,float param_2)

{
  char cVar1;
  CBaseCombatCharacter *pCVar2;
  SurvivorIntention *this_00;
  undefined4 uVar3;
  Vector *pVVar4;
  Vector *pVVar5;
  
  if (*(char *)((int)param_2 + 0x33bc) == '\0') {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(undefined4 *)(this + 8) = 0;
    return this;
  }
  pCVar2 = (CBaseCombatCharacter *)
           SelectTarget((L4D1SurvivorMinigunAttack *)param_1,(SurvivorBot *)param_2);
  if (pCVar2 == (CBaseCombatCharacter *)0x0) {
    AimWeapon((L4D1SurvivorMinigunAttack *)param_1,(SurvivorBot *)param_2);
  }
  else {
    cVar1 = INextBot::IsDebugging((INextBot *)((int)param_2 + 0x4028),3);
    if (cVar1 == '\0') {
      AimWeapon((L4D1SurvivorMinigunAttack *)param_1,(SurvivorBot *)param_2);
    }
    else {
      pVVar4 = (Vector *)(**(code **)(*(int *)pCVar2 + 0x288))(pCVar2);
      pVVar5 = (Vector *)(**(code **)(*(int *)param_2 + 0x288))(param_2);
      NDebugOverlay::HorzArrow(pVVar5,pVVar4,2.0,0xff,0,0,0xff,true,0.01023);
      AimWeapon((L4D1SurvivorMinigunAttack *)param_1,(SurvivorBot *)param_2);
    }
    this_00 = (SurvivorIntention *)(**(code **)(*(int *)param_2 + 0x9a8))(param_2);
    cVar1 = SurvivorIntention::IsDangerousTo(this_00,(CTerrorPlayer *)param_2,pCVar2);
    if (cVar1 == '\0') {
      cVar1 = INextBot::IsDebugging((INextBot *)((int)param_2 + 0x4028),1);
      if (cVar1 != '\0') {
        uVar3 = (**(code **)(*(int *)param_2 + 0x9b8))(param_2);
        DevMsg("%3.2f: %s: NOT FIRING because threat is not dangerous\n",
               (double)*(float *)(gpGlobals + 0xc),uVar3);
      }
    }
    else {
      FireWeapon((L4D1SurvivorMinigunAttack *)param_1,(SurvivorBot *)param_2);
    }
  }
  *(undefined4 *)this = 0;
  *(undefined4 *)(this + 4) = 0;
  *(undefined4 *)(this + 8) = 0;
  return this;
}

SourceMod gamedata

paste into addons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)

Just a Signatures{} block, ready to drop into a gamedata file. Wire it up in your plugin however you like - SDKCall, DHooks, raw memory ops, or anything else.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)