L L4D2node

CDirectorScriptedEventManager::ChangeFinaleStage

0x008b8b30 · 617 bytes · __thiscall

_ZN29CDirectorScriptedEventManager17ChangeFinaleStageENS_18ScriptedEventStageEPKc

Decompiled

undefined (3 params)

/* CDirectorScriptedEventManager::ChangeFinaleStage(CDirectorScriptedEventManager::ScriptedEventStage,
   char const*) */

void __thiscall
CDirectorScriptedEventManager::ChangeFinaleStage
          (CDirectorScriptedEventManager *this,void *param_2,char *param_3)

{
  CDirector *pCVar1;
  int iVar2;
  char *pcVar3;
  int in_GS_OFFSET;
  void *local_b8;
  undefined4 local_b4;
  undefined2 local_b0;
  ushort local_ae;
  void *local_ac;
  undefined4 local_a8;
  undefined2 local_a4;
  ushort local_a2;
  char local_a0 [128];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  UTIL_LogPrintf("ChangeFinaleStage: %d\n",param_2);
  if ((*(int *)this != 5) && (*(int *)this != 3)) {
    if (param_3 == (char *)0x0) {
      iVar2 = (**(code **)(*g_pScriptVM + 0x48))
                        (g_pScriptVM,"OnChangeFinaleStage",*(undefined4 *)(TheDirector + 0x4b8),0);
      (**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar2);
      pCVar1 = TheDirector;
      if (iVar2 != 0) {
        local_b8 = *(void **)this;
        local_ae = 0;
        local_a2 = 0;
        local_a4 = 5;
        local_b4 = 0;
        local_b0 = 5;
        local_a8 = 0;
        local_ac = param_2;
                    /* try { // try from 008b8c8a to 008b8cf6 has its CatchHandler @ 008b8da5 */
        iVar2 = (**(code **)(*g_pScriptVM + 0x48))
                          (g_pScriptVM,"OnChangeFinaleStage",*(undefined4 *)(TheDirector + 0x4b8),0)
        ;
        if (iVar2 != 0) {
          (**(code **)(*g_pScriptVM + 0x50))
                    (g_pScriptVM,iVar2,&local_b8,2,0,*(undefined4 *)(pCVar1 + 0x4b8),1);
          (**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar2);
        }
        if ((local_a2 & 1) != 0) {
          free(local_ac);
          local_a2 = local_a2 & 0xfffe;
        }
        local_ac = (void *)0x0;
        local_a8 = 0;
        local_a4 = 0;
        if ((local_ae & 1) != 0) {
          free(local_b8);
        }
        pcVar3 = (char *)CDirector::GetScriptValue
                                   (TheDirector,"OnChangeFinaleMusic",(char *)0x0,local_a0,0x80);
        if (pcVar3 != (char *)0x0) {
          PlayCustomFinaleMusic(pcVar3);
          MusicMsg("CHANGEFINALESTAGEMUSIC: %s\n",pcVar3);
        }
      }
    }
    else {
      iVar2 = _V_strlen(param_3);
      if (iVar2 != 0) {
        PlayCustomFinaleMusic(param_3);
        MusicMsg("CHANGEFINALESTAGEOVERRIDE: %s\n",param_3);
      }
    }
  }
  iVar2 = *(int *)(in_GS_OFFSET + 0x14);
  *(void **)(this + 4) = param_2;
  if (local_20 == iVar2) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)