ZombieManager::CollateNavAreas
0x00a5c140 · 606 bytes · __thiscall
_ZN13ZombieManager15CollateNavAreasEv
Decompiled
undefined (1 param)
/* ZombieManager::CollateNavAreas() */
void __thiscall ZombieManager::CollateNavAreas(ZombieManager *this)
{
TerrorNavArea *this_00;
CBaseEntity *this_01;
uint uVar1;
int iVar2;
longdouble lVar3;
longdouble lVar4;
float local_3c;
float local_38;
TerrorNavArea *local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
local_28 = 0x3f800000;
local_24 = 0;
local_20 = 0;
*(undefined4 *)(this + 0x248) = 0;
*(undefined4 *)(this + 0x25c) = 0;
*(undefined4 *)(this + 0x270) = 0;
this_01 = (CBaseEntity *)
CGlobalEntityList::FindEntityByName
((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,"Compass",(CBaseEntity *)0x0
,(CBaseEntity *)0x0,(CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
if (this_01 == (CBaseEntity *)0x0) {
local_38 = 0.0;
local_3c = 0.0;
}
else {
if (((byte)this_01[0x14d] & 8) == 0) {
local_3c = *(float *)(this_01 + 0x2e0);
local_38 = *(float *)(this_01 + 0x2e4);
}
else {
CBaseEntity::CalcAbsolutePosition(this_01);
local_3c = *(float *)(this_01 + 0x2e0);
local_38 = *(float *)(this_01 + 0x2e4);
if (((byte)this_01[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_01);
}
}
AngleVectors((QAngle *)(this_01 + 0x37c),(Vector *)&local_28);
}
lVar3 = (longdouble)__atan2f_finite(local_28,local_24);
if (0 < DAT_00fe6000) {
iVar2 = 0;
do {
this_00 = *(TerrorNavArea **)(TheNavAreas + iVar2 * 4);
uVar1 = *(uint *)(this_00 + 300);
if (((uVar1 & 0x40) != 0) && ((uVar1 & 0x18000) == 0)) {
local_2c = this_00;
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)(this + 0x23c),
*(int *)(this + 0x248),(CNavArea **)&local_2c);
uVar1 = *(uint *)(this_00 + 300);
}
if (((uVar1 & 0x100) != 0) && ((uVar1 & 0x18000) == 0)) {
local_2c = this_00;
CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)(this + 0x250),
*(int *)(this + 0x25c),(CNavArea **)&local_2c);
}
iVar2 = iVar2 + 1;
lVar4 = (longdouble)
__atan2f_finite(*(float *)(this_00 + 0x2c) - local_3c,
*(float *)(this_00 + 0x30) - local_38);
TerrorNavArea::SetSpawnAttributes
(this_00,(int)(((((float)lVar4 + 0.3926991) - (float)lVar3) + 6.2831855) * 1.2732395
) % 8 << 0x18);
} while (iVar2 < DAT_00fe6000);
}
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.