CTerrorPlayer::AddToActiveSet
0x009ab3b0 · 329 bytes · __thiscall
_ZN13CTerrorPlayer14AddToActiveSetEP13TerrorNavArea
Decompiled
undefined (2 params)
/* CTerrorPlayer::AddToActiveSet(TerrorNavArea*) */
void __thiscall CTerrorPlayer::AddToActiveSet(CTerrorPlayer *this,TerrorNavArea *param_1)
{
uint uVar1;
int iVar2;
int iVar3;
int iVar4;
void *pvVar5;
int iVar6;
if (param_1 == (TerrorNavArea *)0x0) {
return;
}
uVar1 = *(uint *)(param_1 + 0x15c);
iVar6 = *(int *)(this + 0x2ba0);
if (iVar6 != 8) {
uVar1 = 1 << ((byte)iVar6 & 0x1f) & uVar1;
}
if (uVar1 != 0) {
return;
}
(**(code **)(*(int *)param_1 + 0x7c))(param_1,iVar6);
iVar2 = *(int *)(this + 0x30f4);
iVar4 = *(int *)(this + 0x30ec);
iVar6 = iVar2 + 1;
if (iVar4 < iVar6) {
iVar3 = *(int *)(this + 0x30f0);
if (-1 < iVar3) {
if (iVar3 == 0) {
if (iVar4 == 0) {
if (iVar6 < 9) {
iVar4 = 8;
goto LAB_009ab48f;
}
iVar4 = 8;
}
do {
iVar4 = iVar4 * 2;
} while (iVar4 < iVar6);
}
else {
for (iVar4 = (iVar2 / iVar3 + 1) * iVar3; iVar4 < iVar6; iVar4 = (iVar4 + iVar6) / 2) {
}
}
LAB_009ab48f:
*(int *)(this + 0x30ec) = iVar4;
if (*(void **)(this + 0x30e8) == (void *)0x0) {
pvVar5 = malloc(iVar4 << 2);
*(void **)(this + 0x30e8) = pvVar5;
}
else {
pvVar5 = realloc(*(void **)(this + 0x30e8),iVar4 << 2);
*(void **)(this + 0x30e8) = pvVar5;
iVar6 = *(int *)(this + 0x30f4) + 1;
}
goto LAB_009ab412;
}
}
pvVar5 = *(void **)(this + 0x30e8);
LAB_009ab412:
*(int *)(this + 0x30f4) = iVar6;
iVar6 = (iVar6 - iVar2) + -1;
*(void **)(this + 0x30f8) = pvVar5;
iVar2 = iVar2 * 4;
if (0 < iVar6) {
_V_memmove((void *)((int)pvVar5 + iVar2 + 4),(void *)((int)pvVar5 + iVar2),iVar6 * 4);
pvVar5 = *(void **)(this + 0x30e8);
}
if ((undefined4 *)((int)pvVar5 + iVar2) != (undefined4 *)0x0) {
*(undefined4 *)((int)pvVar5 + iVar2) = param_1;
}
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.