CNavArea::AddLadderUp
0x006fb560 · 281 bytes · __thiscall
_ZN8CNavArea11AddLadderUpEP10CNavLadder
Decompiled
undefined (2 params)
/* CNavArea::AddLadderUp(CNavLadder*) */
void __thiscall CNavArea::AddLadderUp(CNavArea *this,CNavLadder *param_1)
{
size_t __size;
int iVar1;
int *piVar2;
void *pvVar3;
undefined4 *puVar4;
int iVar5;
int iVar6;
int iVar7;
int local_20;
iVar7 = 0;
do {
piVar2 = *(int **)(this + iVar7 * 4 + 0x68);
iVar6 = *piVar2;
if (0 < iVar6) {
if (param_1 == (CNavLadder *)piVar2[1]) {
local_20 = 0;
}
else {
iVar5 = 0;
do {
local_20 = iVar5 + 1;
if (local_20 == iVar6) goto LAB_006fb59d;
iVar1 = iVar5 + 2;
iVar5 = local_20;
} while (param_1 != (CNavLadder *)piVar2[iVar1]);
}
iVar5 = (iVar6 - local_20) + -1;
if (0 < iVar5) {
_V_memmove(piVar2 + local_20 + 1,piVar2 + local_20 + 2,iVar5 * 4);
piVar2 = *(int **)(this + iVar7 * 4 + 0x68);
iVar6 = *piVar2;
}
*piVar2 = iVar6 + -1;
if (**(int **)(this + iVar7 * 4 + 0x68) == 0) {
free(*(int **)(this + iVar7 * 4 + 0x68));
*(undefined4 **)(this + iVar7 * 4 + 0x68) =
&CUtlVectorUltraConservative<NavLadderConnect,CUtlVectorUltraConservativeAllocator>::
StaticData()::staticData;
}
}
LAB_006fb59d:
iVar7 = iVar7 + 1;
if (iVar7 == 2) {
piVar2 = *(int **)(this + 0x68);
iVar6 = *piVar2;
iVar7 = iVar6 + 1;
if (piVar2 == &CUtlVectorUltraConservative<NavLadderConnect,CUtlVectorUltraConservativeAllocator>
::StaticData()::staticData) {
puVar4 = malloc(iVar7 * 4 + 4);
*(undefined4 **)(this + 0x68) = puVar4;
*puVar4 = 0;
pvVar3 = *(void **)(this + 0x68);
}
else {
__size = iVar7 * 4 + 4;
iVar7 = malloc_usable_size(piVar2);
if (iVar7 < (int)__size) {
pvVar3 = realloc(*(void **)(this + 0x68),__size);
*(void **)(this + 0x68) = pvVar3;
}
else {
pvVar3 = *(void **)(this + 0x68);
}
}
*(CNavLadder **)((int)pvVar3 + iVar6 * 4 + 4) = param_1;
**(int **)(this + 0x68) = **(int **)(this + 0x68) + 1;
return;
}
} while( true );
}
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.