ZombieManager::RelocateZombie
0x00a5e530 · 966 bytes · __thiscall
_ZN13ZombieManager14RelocateZombieEP13CTerrorPlayer
Decompiled
undefined (2 params)
/* ZombieManager::RelocateZombie(CTerrorPlayer*) */
undefined4 __thiscall ZombieManager::RelocateZombie(ZombieManager *this,CTerrorPlayer *param_1)
{
code *pcVar1;
float fVar2;
float fVar3;
CBaseEntity *pCVar4;
char cVar5;
int iVar6;
undefined4 uVar7;
int *piVar8;
undefined4 uVar9;
undefined8 uVar10;
float local_60;
float local_5c;
float local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c;
float local_48;
float local_44;
float local_40;
float local_3c;
float local_38;
float local_34;
undefined4 local_30;
undefined1 local_2c;
CBaseEntity *local_28;
undefined4 local_24;
undefined4 local_20;
cVar5 = (**(code **)(*(int *)param_1 + 300))(param_1);
if ((cVar5 != '\0') &&
(((iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar6 != 3 ||
(iVar6 = (**(code **)(*(int *)param_1 + 0x544))(param_1), iVar6 != 8)) &&
(iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar6 == 3)))) {
uVar7 = (**(code **)(*(int *)param_1 + 0x544))(param_1);
piVar8 = (int *)CollectSpawnAreas(this,3);
if (piVar8[3] != 0) {
iVar6 = RandomInt(0,piVar8[3] + -1);
uVar9 = *(undefined4 *)(*piVar8 + iVar6 * 4);
uVar10 = CONCAT44(uVar7,uVar9);
TerrorNavArea::FindRandomSpot();
local_60 = local_3c;
local_5c = local_38;
local_58 = local_34 + 5.0;
uVar7 = (**(code **)(*(int *)param_1 + 0x544))(param_1,uVar10);
uVar7 = CanZombieSpawnHere(this,&local_60,uVar9,uVar7,0,param_1);
if ((char)uVar7 == '\0') {
if (*(int *)(ZombieDebug._28_4_ + 0x30) == 0) {
return uVar7;
}
uVar9 = (**(code **)(*(int *)param_1 + 0x544))(param_1);
uVar9 = ZombieClassName(uVar9);
Msg("RelocateOrCullZombie: Spot blocked (%.0f, %.0f, %.0f) for a %s%s\n",(double)local_60,
(double)local_5c,(double)local_58,"(mob) ",uVar9);
return uVar7;
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
local_54 = *(undefined4 *)(param_1 + 0x37c);
local_30 = 2;
local_2c = 1;
local_28 = (CBaseEntity *)0x0;
local_3c = local_60;
local_50 = *(undefined4 *)(param_1 + 0x380);
local_38 = local_5c;
local_24 = 0x4e6e6b28;
local_34 = local_58;
local_4c = *(undefined4 *)(param_1 + 900);
local_20 = 0;
ForEachPlayer<ClosestPlayerScan>((ClosestPlayerScan *)&local_3c);
pCVar4 = local_28;
if (local_28 != (CBaseEntity *)0x0) {
if (((byte)local_28[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(local_28);
}
local_48 = *(float *)(pCVar4 + 0x2e0) - local_60;
local_44 = *(float *)(pCVar4 + 0x2e4) - local_5c;
local_40 = *(float *)(pCVar4 + 0x2e8) - local_58;
VectorAngles((Vector *)&local_48,(QAngle *)&local_54);
}
(**(code **)(*(int *)param_1 + 0x1dc))(param_1,&local_60,&local_54,&vec3_origin);
fVar3 = DAT_01053d44;
fVar2 = DAT_01053d40;
if (((vec3_angle != *(float *)(param_1 + 0x1ab0)) ||
(DAT_01053d40 != *(float *)(param_1 + 0x1ab4))) ||
(DAT_01053d44 != *(float *)(param_1 + 0x1ab8))) {
(**(code **)(*(int *)(param_1 + 0x1a40) + 4))(param_1 + 0x1a40,param_1 + 0x1ab0);
*(float *)(param_1 + 0x1ab0) = vec3_angle;
*(float *)(param_1 + 0x1ab4) = fVar2;
*(float *)(param_1 + 0x1ab8) = fVar3;
}
CTerrorGameRules::OnPlayerTeleported(g_pGameRules,param_1);
piVar8 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"relocated",0,0);
if (piVar8 == (int *)0x0) {
return uVar7;
}
pcVar1 = *(code **)(*piVar8 + 0x30);
uVar9 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
(*pcVar1)(piVar8,"userid",uVar9);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar8,0);
return uVar7;
}
}
return 0;
}
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.