L L4D2node

CDirector::ShuffleThreatRoster

0x008716f0 · 293 bytes · __thiscall

_ZN9CDirector19ShuffleThreatRosterE15ZombieClassType

Decompiled

undefined (2 params)

/* CDirector::ShuffleThreatRoster(ZombieClassType) */

void __thiscall CDirector::ShuffleThreatRoster(CDirector *this,int param_2)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  
  cVar1 = CDirectorVersusMode::IsOverridingThreats();
  if (cVar1 == '\0') {
    *(undefined4 *)(this + 0x444) = 7;
    *(undefined4 *)(this + 0x448) = 8;
    *(undefined4 *)(this + 0x44c) = 9;
    iVar2 = RandomInt(0,2);
    uVar3 = *(undefined4 *)(this + 0x44c);
    *(undefined4 *)(this + 0x44c) = *(undefined4 *)(this + iVar2 * 4 + 0x444);
    *(undefined4 *)(this + iVar2 * 4 + 0x444) = uVar3;
    iVar2 = RandomInt(0,1);
    uVar3 = *(undefined4 *)(this + 0x448);
    *(undefined4 *)(this + 0x448) = *(undefined4 *)(this + iVar2 * 4 + 0x444);
    *(undefined4 *)(this + iVar2 * 4 + 0x444) = uVar3;
    if ((*(int *)(this + 0x444) == 8) && (param_2 == 8)) {
      iVar2 = RandomInt(1,2);
      *(undefined4 *)(this + 0x444) = *(undefined4 *)(this + iVar2 * 4 + 0x444);
      *(undefined4 *)(this + iVar2 * 4 + 0x444) = 8;
    }
    *(undefined4 *)(this + 0x450) = 0;
    if (*(int *)(DirectorDebugThreatPlacement._28_4_ + 0x30) != 0) {
      iVar2 = 0;
      do {
        uVar3 = ZombieClassName(*(undefined4 *)(this + iVar2 * 4 + 0x444));
        iVar4 = iVar2 + 1;
        DevMsg("Threat[%d] = %s\n",iVar2,uVar3);
        iVar2 = iVar4;
      } while (iVar4 != 3);
    }
  }
  return;
}

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)