L L4D2node

TankIdle::Update

0x00aef670 · 308 bytes · __thiscall

_ZN8TankIdle6UpdateEP4Tankf

Decompiled

undefined (3 params)

/* TankIdle::Update(Tank*, float) */

TankIdle * __thiscall TankIdle::Update(TankIdle *this,Tank *param_1,float param_2)

{
  char cVar1;
  TankAttack *pTVar2;
  CTerrorPlayer *pCVar3;
  longdouble lVar4;
  longdouble lVar5;
  
  cVar1 = CDirectorTacticalServices::IsVisibleToTeam
                    (*(CDirectorTacticalServices **)(TheDirector + 0x628),(CBaseEntity *)param_2,2,7
                     ,0.0,(TerrorNavArea *)0x0);
  if (cVar1 != '\0') {
    pTVar2 = ::operator_new(0x487c);
                    /* try { // try from 00aef6ca to 00aef6ce has its CatchHandler @ 00aef7c1 */
    TankAttack::TankAttack(pTVar2);
    *(undefined4 *)this = 1;
    *(TankAttack **)(this + 4) = pTVar2;
    *(char **)(this + 8) = "We see a victim!";
    return this;
  }
  pCVar3 = (CTerrorPlayer *)
           CDirectorTacticalServices::GetHighestFlowSurvivor
                     (*(CDirectorTacticalServices **)(TheDirector + 0x628),0);
  if (pCVar3 != (CTerrorPlayer *)0x0) {
    lVar4 = (longdouble)CTerrorPlayer::GetFlowDistance(pCVar3,0);
    lVar5 = (longdouble)CTerrorPlayer::GetFlowDistance((CTerrorPlayer *)param_2,0);
    if ((float)lVar5 + 500.0 < (float)lVar4) {
      pTVar2 = ::operator_new(0x487c);
                    /* try { // try from 00aef76b to 00aef76f has its CatchHandler @ 00aef7af */
      TankAttack::TankAttack(pTVar2);
      *(undefined4 *)this = 1;
      *(TankAttack **)(this + 4) = pTVar2;
      *(char **)(this + 8) = "The Survivors have passed me by!";
      return this;
    }
  }
  *(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)