TerrorNavArea::ScriptGetElevatorAreas
0x009786b0 · 408 bytes · __thiscall
_ZN13TerrorNavArea22ScriptGetElevatorAreasEP9HSCRIPT__
Decompiled
undefined (2 params)
/* TerrorNavArea::ScriptGetElevatorAreas(HSCRIPT__*) */
void __thiscall TerrorNavArea::ScriptGetElevatorAreas(TerrorNavArea *this,HSCRIPT__ *param_1)
{
code *pcVar1;
TerrorNavArea *pTVar2;
int *piVar3;
int iVar4;
int in_GS_OFFSET;
void *local_138 [2];
undefined2 local_130;
ushort local_12e;
CFmtStrN<256> local_12c [5];
undefined1 local_127 [263];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (param_1 + -1 < (HSCRIPT__ *)0xfffffffe) {
if ((CNavArea::GetElevatorAreas()::empty == '\0') &&
(iVar4 = __cxa_guard_acquire(&CNavArea::GetElevatorAreas()::empty), iVar4 != 0)) {
if ((CUtlVectorUltraConservative<NavConnect,CUtlVectorUltraConservativeAllocator>::
StaticData()::staticData == '\0') &&
(iVar4 = __cxa_guard_acquire(&CUtlVectorUltraConservative<NavConnect,CUtlVectorUltraConservativeAllocator>
::StaticData()::staticData), iVar4 != 0)) {
__cxa_guard_release(&CUtlVectorUltraConservative<NavConnect,CUtlVectorUltraConservativeAllocator>
::StaticData()::staticData);
}
CNavArea::GetElevatorAreas()::empty =
&CUtlVectorUltraConservative<NavConnect,CUtlVectorUltraConservativeAllocator>::
StaticData()::staticData;
__cxa_guard_release(&CNavArea::GetElevatorAreas()::empty);
__cxa_atexit(CUtlVectorUltraConservative<NavConnect,CUtlVectorUltraConservativeAllocator>::
~CUtlVectorUltraConservative,&CNavArea::GetElevatorAreas()::empty,&__dso_handle);
}
pTVar2 = this + 0x88;
if (((byte)this[0x57] & 0x40) == 0) {
pTVar2 = (TerrorNavArea *)&CNavArea::GetElevatorAreas()::empty;
}
piVar3 = *(int **)pTVar2;
if (0 < *piVar3) {
iVar4 = 0;
do {
if ((TerrorNavArea *)piVar3[iVar4 * 2 + 1] != (TerrorNavArea *)0x0) {
pcVar1 = *(code **)(*g_pScriptVM + 0x78);
local_138[0] = (void *)GetScriptInstance((TerrorNavArea *)piVar3[iVar4 * 2 + 1]);
local_130 = 0x20;
local_12e = 0;
/* try { // try from 00978784 to 009787aa has its CatchHandler @ 0097884c */
CFmtStrN<256>::CFmtStrN(local_12c,"area%i",iVar4);
(*pcVar1)(g_pScriptVM,param_1,local_127,local_138);
if ((local_12e & 1) != 0) {
free(local_138[0]);
}
piVar3 = *(int **)pTVar2;
}
iVar4 = iVar4 + 1;
} while (iVar4 < *piVar3);
}
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.