CTerrorPlayer::OnZombieSpawned
0x009b42b0 · 497 bytes · __thiscall
_ZN13CTerrorPlayer15OnZombieSpawnedEPS_
Decompiled
undefined (2 params)
/* CTerrorPlayer::OnZombieSpawned(CTerrorPlayer*) */
void __thiscall CTerrorPlayer::OnZombieSpawned(CTerrorPlayer *this,CTerrorPlayer *param_1)
{
CBaseEdict *this_00;
char cVar1;
int iVar2;
undefined4 uVar3;
int *piVar4;
float fVar5;
longdouble lVar6;
float local_14;
if ((((param_1 != (CTerrorPlayer *)0x0) &&
(iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar2 == 3)) &&
(iVar2 = (**(code **)(*(int *)param_1 + 0x544))(param_1), iVar2 == 8)) &&
((cVar1 = (**(code **)(*(int *)this + 300))(this), cVar1 == '\0' ||
(cVar1 = (**(code **)(*(int *)this + 0x558))(this), cVar1 != '\0')))) {
if (*(int *)(this + 0x2c14) == 1) {
piVar4 = (int *)CDirectorTacticalServices::GetHighestFlowSurvivor
(*(CDirectorTacticalServices **)(TheDirector + 0x628),0);
if (piVar4 != (int *)0x0) {
iVar2 = (**(code **)(*piVar4 + 0x52c))(piVar4);
if (iVar2 == 0) {
local_14 = -9999.0;
}
else {
local_14 = *(float *)(iVar2 + 0x154);
}
lVar6 = (longdouble)GetLineOfScrimmageDistance();
if ((float)lVar6 + local_14 < *(float *)(this + 0x2bc0) ||
(float)lVar6 + local_14 == *(float *)(this + 0x2bc0)) {
piVar4 = (int *)CDirectorTacticalServices::GetHighestFlowSurvivor
(*(CDirectorTacticalServices **)(TheDirector + 0x628),0);
if (piVar4 == (int *)0x0) {
return;
}
iVar2 = (**(code **)(*piVar4 + 0x52c))(piVar4);
if (iVar2 == 0) {
fVar5 = -9999.0;
}
else {
fVar5 = *(float *)(iVar2 + 0x154);
}
lVar6 = (longdouble)GetLineOfScrimmageDistance();
if (*(float *)(this + 0x2be0) <= fVar5 - (float)lVar6) {
return;
}
}
uVar3 = (**(code **)(*(int *)this + 0xb8))(this);
UTIL_LogPrintf("%s is updating line of scrimmage at tank battle start\n",uVar3);
UpdateLineOfScrimmage(this,-1.0,-1.0);
}
}
else if (*(int *)(this + 0x2c14) == 2) {
uVar3 = (**(code **)(*(int *)this + 0xb8))(this);
UTIL_LogPrintf("%s is updating line of scrimmage at tank battle start\n",uVar3);
ResizeScrimmageSphere(this);
if (*(float *)(this + 0x2c18) != 0.0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar2 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar2 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x2c18) = 0;
}
}
}
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.