L L4D2node

CDirector::TermScriptLevel

0x00872280 · 268 bytes · __thiscall

_ZN9CDirector15TermScriptLevelEi.part.358

Decompiled

undefined (2 params)

/* CDirector::TermScriptLevel(int) [clone .part.358] */

void __thiscall CDirector::TermScriptLevel(CDirector *this,int param_1)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  int in_EAX;
  int *__ptr;
  int in_EDX;
  int iVar4;
  
  if (in_EDX == 3) {
    CDirectorChallengeMode::TermScripts(*(CDirectorChallengeMode **)(in_EAX + 0x648));
  }
  piVar3 = g_pScriptVM;
  iVar2 = in_EAX + 0x480 + in_EDX * 0xc;
  if (*(int *)(iVar2 + 8) != -1) {
    __ptr = *(int **)(iVar2 + 0x10);
    if ((g_pScriptVM != (int *)0x0) && (0 < *__ptr)) {
      iVar4 = 0;
      do {
        (**(code **)(*piVar3 + 0x4c))(piVar3,*(undefined4 *)__ptr[iVar4 + 1]);
        iVar1 = iVar4 * 4;
        iVar4 = iVar4 + 1;
        **(undefined4 **)(*(int *)(iVar2 + 0x10) + 4 + iVar1) = 0xffffffff;
        __ptr = *(int **)(iVar2 + 0x10);
      } while (iVar4 < *__ptr);
    }
    if (__ptr != &CUtlVectorUltraConservative<HSCRIPT__**,CUtlVectorUltraConservativeAllocator>::
                  StaticData()::staticData) {
      free(__ptr);
      *(undefined4 **)(iVar2 + 0x10) =
           &CUtlVectorUltraConservative<HSCRIPT__**,CUtlVectorUltraConservativeAllocator>::
            StaticData()::staticData;
    }
    if (((*(int *)(iVar2 + 8) != 0) && (piVar3 != (int *)0x0)) &&
       ((*(byte *)(iVar2 + 0xc) & 1) == 0)) {
      (**(code **)(*piVar3 + 0x44))(piVar3,*(int *)(iVar2 + 8));
    }
    *(undefined4 *)(iVar2 + 8) = 0xffffffff;
  }
  *(undefined4 *)(iVar2 + 0xc) = 0;
  iVar2 = in_EAX + in_EDX * 4;
  iVar4 = *(int *)(iVar2 + 0x4c4);
  if (iVar4 != 0) {
    (**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar4);
    *(undefined4 *)(iVar2 + 0x4c4) = 0;
  }
  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)