CDirector::EndLocalScript
0x0087dc90 · 516 bytes · __thiscall
_ZN9CDirector14EndLocalScriptEv
Decompiled
undefined (1 param)
/* CDirector::EndLocalScript() */
void __thiscall CDirector::EndLocalScript(CDirector *this)
{
int iVar1;
int *piVar2;
char cVar3;
undefined4 uVar4;
int *piVar5;
int iVar6;
piVar2 = g_pScriptVM;
if ((*(int *)(this + 0x4a0) != -1) && (g_pScriptVM != (int *)0x0)) {
piVar5 = *(int **)(this + 0x4a8);
if (0 < *piVar5) {
iVar6 = 0;
do {
(**(code **)(*piVar2 + 0x4c))(piVar2,*(undefined4 *)piVar5[iVar6 + 1]);
iVar1 = iVar6 * 4;
iVar6 = iVar6 + 1;
**(undefined4 **)(*(int *)(this + 0x4a8) + 4 + iVar1) = 0xffffffff;
piVar5 = *(int **)(this + 0x4a8);
} while (iVar6 < *piVar5);
}
if (piVar5 != &CUtlVectorUltraConservative<HSCRIPT__**,CUtlVectorUltraConservativeAllocator>::
StaticData()::staticData) {
free(piVar5);
*(undefined4 **)(this + 0x4a8) =
&CUtlVectorUltraConservative<HSCRIPT__**,CUtlVectorUltraConservativeAllocator>::
StaticData()::staticData;
}
if ((*(int *)(this + 0x4a0) != 0) && (((byte)this[0x4a4] & 1) == 0)) {
(**(code **)(*piVar2 + 0x44))(piVar2,*(int *)(this + 0x4a0));
}
*(undefined4 *)(this + 0x4a0) = 0xffffffff;
piVar2 = g_pScriptVM;
*(undefined4 *)(this + 0x4a4) = 0;
cVar3 = (**(code **)(*piVar2 + 0x70))(piVar2,*(undefined4 *)(this + 0x494),"LocalScript");
if (cVar3 != '\0') {
Warning("Failed to correctly clean up local script");
(**(code **)(*g_pScriptVM + 0xa0))(g_pScriptVM,*(undefined4 *)(this + 0x494),"LocalScript");
}
iVar6 = 0;
if (*(int *)(this + 0x494) != -1) {
iVar6 = *(int *)(this + 0x494);
}
uVar4 = (**(code **)(*g_pScriptVM + 0x3c))(g_pScriptVM,"LocalScript",iVar6);
*(undefined4 *)(this + 0x4a0) = uVar4;
piVar2 = g_pScriptVM;
if (*(int *)(this + 0x4b8) != -1) {
piVar5 = *(int **)(this + 0x4c0);
if ((g_pScriptVM != (int *)0x0) && (0 < *piVar5)) {
iVar6 = 0;
do {
(**(code **)(*piVar2 + 0x4c))(piVar2,*(undefined4 *)piVar5[iVar6 + 1]);
iVar1 = iVar6 * 4;
iVar6 = iVar6 + 1;
**(undefined4 **)(*(int *)(this + 0x4c0) + 4 + iVar1) = 0xffffffff;
piVar5 = *(int **)(this + 0x4c0);
} while (iVar6 < *piVar5);
}
if (piVar5 != &CUtlVectorUltraConservative<HSCRIPT__**,CUtlVectorUltraConservativeAllocator>::
StaticData()::staticData) {
free(piVar5);
*(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;
PostRunScript(this);
return;
}
return;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.