L L4D2node

CDirector::TermScripts

0x00876960 · 414 bytes · __thiscall

_ZN9CDirector11TermScriptsEv

Decompiled

undefined (1 param)

/* CDirector::TermScripts() */

void __thiscall CDirector::TermScripts(CDirector *this)

{
  int iVar1;
  int *piVar2;
  int *__ptr;
  int iVar3;
  CDirector *pCVar4;
  CDirector *in_stack_ffffffd4;
  int in_stack_ffffffd8;
  
  ScriptCollectGarbage();
  ClearScriptGameEventListeners();
  if (g_pScriptVM == (int *)0x0) {
    iVar3 = 0;
    pCVar4 = this;
    do {
      *(undefined4 *)(pCVar4 + 0x488) = 0xffffffff;
      *(undefined4 *)(pCVar4 + 0x48c) = 0;
      if (*(undefined4 **)(this + (int)(pCVar4 + (0x490 - (int)this))) !=
          &CUtlVectorUltraConservative<HSCRIPT__**,CUtlVectorUltraConservativeAllocator>::
           StaticData()::staticData) {
        free(*(undefined4 **)(this + (int)(pCVar4 + (0x490 - (int)this))));
        *(undefined4 **)(this + (int)(pCVar4 + (0x490 - (int)this))) =
             &CUtlVectorUltraConservative<HSCRIPT__**,CUtlVectorUltraConservativeAllocator>::
              StaticData()::staticData;
      }
      *(undefined4 *)(this + iVar3 * 4 + 0x4c4) = 0;
      iVar3 = iVar3 + 1;
      pCVar4 = pCVar4 + 0xc;
    } while (iVar3 != 4);
    *(undefined4 *)(this + 0x4b8) = 0xffffffff;
    *(undefined4 *)(this + 0x4bc) = 0;
    if (*(undefined4 **)(this + 0x4c0) !=
        &CUtlVectorUltraConservative<HSCRIPT__**,CUtlVectorUltraConservativeAllocator>::StaticData()
         ::staticData) {
      free(*(undefined4 **)(this + 0x4c0));
      *(undefined4 **)(this + 0x4c0) =
           &CUtlVectorUltraConservative<HSCRIPT__**,CUtlVectorUltraConservativeAllocator>::
            StaticData()::staticData;
      ScriptCollectGarbage();
      return;
    }
  }
  else {
    iVar3 = 0;
    if (*(int *)(this + 0x488) != -1) {
      do {
        iVar3 = iVar3 + 1;
        TermScriptLevel(in_stack_ffffffd4,in_stack_ffffffd8);
        piVar2 = g_pScriptVM;
      } while (iVar3 != 4);
      if (*(int *)(this + 0x4b8) != -1) {
        __ptr = *(int **)(this + 0x4c0);
        if ((g_pScriptVM != (int *)0x0) && (0 < *__ptr)) {
          iVar3 = 0;
          do {
            (**(code **)(*piVar2 + 0x4c))(piVar2,*(undefined4 *)__ptr[iVar3 + 1]);
            iVar1 = iVar3 * 4;
            iVar3 = iVar3 + 1;
            **(undefined4 **)(*(int *)(this + 0x4c0) + 4 + iVar1) = 0xffffffff;
            __ptr = *(int **)(this + 0x4c0);
          } while (iVar3 < *__ptr);
        }
        if (__ptr != &CUtlVectorUltraConservative<HSCRIPT__**,CUtlVectorUltraConservativeAllocator>
                      ::StaticData()::staticData) {
          free(__ptr);
          *(undefined4 **)(this + 0x4c0) =
               &CUtlVectorUltraConservative<HSCRIPT__**,CUtlVectorUltraConservativeAllocator>::
                StaticData()::staticData;
        }
        if (((*(int *)(this + 0x4b8) != 0) && (piVar2 != (int *)0x0)) &&
           (((byte)this[0x4bc] & 1) == 0)) {
          (**(code **)(*piVar2 + 0x44))(piVar2,*(int *)(this + 0x4b8));
        }
        *(undefined4 *)(this + 0x4b8) = 0xffffffff;
      }
      *(undefined4 *)(this + 0x4bc) = 0;
    }
  }
  ScriptCollectGarbage();
  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)