L L4D2node

CDirector::GetThreatType

0x0087c7d0 · 176 bytes · __thiscall

_ZN9CDirector13GetThreatTypeEv

Decompiled

undefined (1 param)

/* CDirector::GetThreatType() */

int __thiscall CDirector::GetThreatType(CDirector *this)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar1 = *(int *)(this + *(int *)(this + 0x450) * 4 + 0x444);
  iVar2 = GetScriptValue(this,"DisallowThreatType",0);
  while (((iVar1 == iVar2 || (iVar1 == 8)) &&
         ((this[0x4f5] == (CDirector)0x0 ||
          ((iVar3 = RandomInt(1,100), 0x4b < iVar3 || (iVar1 == iVar2))))))) {
    iVar1 = *(int *)(this + 0x450) + 1;
    *(int *)(this + 0x450) = iVar1;
    if (iVar1 < 3) {
      iVar1 = *(int *)(this + iVar1 * 4 + 0x444);
    }
    else {
      (**(code **)(*(int *)this + 0x60))(this,9);
      iVar1 = *(int *)(this + *(int *)(this + 0x450) * 4 + 0x444);
    }
  }
  return iVar1;
}

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)