L L4D2node

CDirectorChallengeMode::ShutdownScriptedMode

0x0089eb60 · 373 bytes · __thiscall

_ZN22CDirectorChallengeMode20ShutdownScriptedModeE15eShutdownReasonPKc

Decompiled

undefined (3 params)

/* CDirectorChallengeMode::ShutdownScriptedMode(eShutdownReason, char const*) */

void __thiscall
CDirectorChallengeMode::ShutdownScriptedMode
          (CDirectorChallengeMode *this,void *param_2,void *param_3)

{
  undefined4 *puVar1;
  int iVar2;
  void *local_40 [2];
  undefined2 local_38;
  ushort local_36;
  void *local_34;
  undefined4 local_30;
  undefined2 local_2c;
  ushort local_2a;
  void *local_28;
  undefined4 local_24;
  undefined2 local_20;
  ushort local_1e;
  
  if (*this != (CDirectorChallengeMode)0x0) {
    *this = (CDirectorChallengeMode)0x0;
    puVar1 = *(undefined4 **)(this + 0x140);
    local_2c = 5;
    local_1e = 0;
    local_38 = 0;
    local_34 = param_2;
    local_20 = 0x1f;
    local_36 = 0;
    local_40[0] = (void *)0x0;
    local_2a = 0;
    local_28 = param_3;
    local_30 = 0;
    local_24 = 0;
                    /* try { // try from 0089ebfd to 0089ec4e has its CatchHandler @ 0089ecf1 */
    iVar2 = (**(code **)(*g_pScriptVM + 0x48))(g_pScriptVM,"ScriptMode_OnShutdown",*puVar1,0);
    if (iVar2 != 0) {
      (**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,iVar2,&local_34,2,local_40,*puVar1,1,&local_34)
      ;
      (**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar2);
    }
    if ((local_1e & 1) != 0) {
      free(local_28);
      local_1e = local_1e & 0xfffe;
    }
    local_28 = (void *)0x0;
    local_24 = 0;
    local_20 = 0;
    if ((local_2a & 1) != 0) {
      free(local_34);
    }
                    /* try { // try from 0089ec92 to 0089ecbe has its CatchHandler @ 0089ecdc */
    CDirector::InitChallengeScope(TheDirector);
    CDirector::PostRunScript(TheDirector);
    if (g_pGameRules != (CTerrorGameRules *)0x0) {
      CTerrorGameRules::SetChallengeModeActive(g_pGameRules,(bool)*this);
    }
    if ((local_36 & 1) != 0) {
      free(local_40[0]);
      return;
    }
  }
  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)