L L4D2node

CDirectorChallengeMode::ConvertZombieClass

0x008a0390 · 355 bytes · __thiscall

_ZNK22CDirectorChallengeMode18ConvertZombieClassEi

Decompiled

undefined (2 params)

/* CDirectorChallengeMode::ConvertZombieClass(int) const */

void * __thiscall
CDirectorChallengeMode::ConvertZombieClass(CDirectorChallengeMode *this,int param_1)

{
  int iVar1;
  int iVar2;
  void *pvVar3;
  void *local_34 [2];
  short local_2c;
  ushort local_2a;
  void *local_28;
  undefined4 local_24;
  undefined2 local_20;
  ushort local_1e;
  
  if (this[1] != (CDirectorChallengeMode)0x0) {
    iVar2 = (**(code **)(*g_pScriptVM + 0x48))
                      (g_pScriptVM,"ConvertZombieClass",*(undefined4 *)(TheDirector + 0x4b8),0);
    (**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar2);
    iVar1 = TheDirector;
    if (iVar2 != 0) {
      local_2c = 0;
      local_1e = 0;
      local_2a = 0;
      local_34[0] = (void *)0x0;
      local_28 = (void *)param_1;
      local_24 = 0;
      local_20 = 5;
                    /* try { // try from 008a0456 to 008a04ab has its CatchHandler @ 008a04f6 */
      iVar2 = (**(code **)(*g_pScriptVM + 0x48))
                        (g_pScriptVM,"ConvertZombieClass",*(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);
      }
      pvVar3 = (void *)(int)(float)local_34[0];
      if (local_2c == 5) {
        pvVar3 = local_34[0];
      }
      if (7 < (int)pvVar3 - 1U) {
        pvVar3 = (void *)param_1;
      }
      if ((local_2a & 1) != 0) {
        free(local_34[0]);
      }
      return pvVar3;
    }
  }
  return (void *)param_1;
}

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)