L L4D2node

CDirector::GetTankHealth

0x00879070 · 146 bytes · __thiscall

_ZNK9CDirector13GetTankHealthEv

Decompiled

undefined (1 param)

/* CDirector::GetTankHealth() const */

longdouble __thiscall CDirector::GetTankHealth(CDirector *this)

{
  char cVar1;
  int iVar2;
  longdouble lVar3;
  float local_10;
  
  iVar2 = GetDifficulty();
  local_10 = 0.75;
  if (iVar2 != 0) {
    if ((iVar2 < 0) || (1 < iVar2 - 2U)) {
      local_10 = 1.0;
    }
    else {
      local_10 = 2.0;
    }
  }
  cVar1 = CTerrorGameRules::HasPlayerControlledZombies();
  if (cVar1 != '\0') {
    local_10 = 1.5;
  }
  lVar3 = (longdouble)
          GetScriptValue(this,"ZombieTankHealth",*(float *)(ZombieTankHealth._28_4_ + 0x2c));
  return (longdouble)((float)lVar3 * local_10);
}

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)