L L4D2node

CDirectorChallengeMode::ShouldAvoidItem

0x008a0520 · 341 bytes · __thiscall

_ZNK22CDirectorChallengeMode15ShouldAvoidItemE10CSWeaponID

Decompiled

undefined (2 params)

/* CDirectorChallengeMode::ShouldAvoidItem(CSWeaponID) const */

uint __thiscall
CDirectorChallengeMode::ShouldAvoidItem(CDirectorChallengeMode *this,undefined4 param_2)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  void *local_34 [2];
  undefined2 local_2c;
  ushort local_2a;
  void *local_28;
  undefined4 local_24;
  undefined2 local_20;
  ushort local_1e;
  
  if (this[1] != (CDirectorChallengeMode)0x0) {
    iVar1 = (**(code **)(*g_pScriptVM + 0x48))
                      (g_pScriptVM,"ShouldAvoidItem",*(undefined4 *)(TheDirector + 0x4b8),0);
    (**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar1);
    if (iVar1 != 0) {
      local_2c = 0;
      local_2a = 0;
      local_34[0] = (void *)0x0;
                    /* try { // try from 008a059d to 008a05a1 has its CatchHandler @ 008a0679 */
      local_28 = (void *)WeaponIDToClassname(param_2);
      iVar1 = TheDirector;
      local_1e = 0;
      local_20 = 0x1f;
      local_24 = 0;
                    /* try { // try from 008a05ee to 008a0643 has its CatchHandler @ 008a068e */
      iVar2 = (**(code **)(*g_pScriptVM + 0x48))
                        (g_pScriptVM,"ShouldAvoidItem",*(undefined4 *)(TheDirector + 0x4b8),0);
      if (iVar2 != 0) {
        (**(code **)(*g_pScriptVM + 0x50))
                  (g_pScriptVM,iVar2,&local_28,1,local_34,*(undefined4 *)(iVar1 + 0x4b8),1,&local_28
                  );
        (**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar2);
      }
      if ((local_1e & 1) != 0) {
        free(local_28);
      }
      uVar3 = (uint)local_34[0] & 0xff;
      if ((local_2a & 1) == 0) {
        return uVar3;
      }
      free(local_34[0]);
      return uVar3;
    }
  }
  return 0;
}

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)