CTerrorPlayer::UpdateStagger
0x009f8570 · 831 bytes · __thiscall
_ZN13CTerrorPlayer13UpdateStaggerEv
Decompiled
undefined (1 param)
/* CTerrorPlayer::UpdateStagger() */
void __thiscall CTerrorPlayer::UpdateStagger(CTerrorPlayer *this)
{
float *pfVar1;
uint uVar2;
CBaseEdict *this_00;
char cVar3;
undefined4 uVar4;
int iVar5;
undefined *puVar6;
longdouble lVar7;
float fVar8;
while (iVar5 = *(int *)(this + 0x338c), iVar5 != 0) {
do {
pfVar1 = *(float **)(this + 0x3380);
fVar8 = *(float *)(gpGlobals + 0xc) - *(float *)(BoomerShoveInterval._28_4_ + 0x2c);
if (fVar8 < *pfVar1 || fVar8 == *pfVar1) goto LAB_009f8585;
iVar5 = iVar5 + -1;
if (0 < iVar5) {
_V_memmove(pfVar1,pfVar1 + 1,iVar5 * 4);
iVar5 = *(int *)(this + 0x338c) + -1;
}
*(int *)(this + 0x338c) = iVar5;
} while (iVar5 != 0);
uVar4 = RandomInt(*(undefined4 *)(BoomerShoveMin._28_4_ + 0x30),
*(undefined4 *)(BoomerShoveMax._28_4_ + 0x30));
*(undefined4 *)(this + 0x337c) = uVar4;
}
LAB_009f8585:
cVar3 = CTerrorGameRules::HasPlayerControlledZombies();
if ((((cVar3 == '\0') || (*(float *)(this + 0x31f8) <= 0.0)) ||
(lVar7 = (longdouble)CountdownTimer::Now(), (float)lVar7 < *(float *)(this + 0x31f8))) ||
((((iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this), iVar5 != 3 ||
(iVar5 = (**(code **)(*(int *)this + 0x544))(this), iVar5 != 1)) &&
((iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this), iVar5 != 3 ||
(iVar5 = (**(code **)(*(int *)this + 0x544))(this), iVar5 != 3)))) &&
((iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this), iVar5 != 3 ||
(iVar5 = (**(code **)(*(int *)this + 0x544))(this), iVar5 != 5)))))) {
cVar3 = (**(code **)(*(int *)this + 300))(this);
if ((cVar3 != '\0') && (iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this), iVar5 == 3)) {
if (*(int *)(this + 0x3218) == -1) {
return;
}
iVar5 = CBaseEntity::GetGroundEntity((CBaseEntity *)this);
if (iVar5 == 0) {
return;
}
(**(code **)(*(int *)this + 0x7fc))(this,0x44,*(undefined4 *)(this + 0x3218));
(**(code **)(**(int **)(this + 0x2910) + 0x7c))(*(int **)(this + 0x2910));
fVar8 = *(float *)(ZombieMaxStaggerDuration._28_4_ + 0x2c);
lVar7 = (longdouble)CountdownTimer::Now();
if ((float)lVar7 + fVar8 != *(float *)(this + 0x31f8)) {
(**(code **)(*(int *)(this + 0x31f0) + 4))(this + 0x31f0,this + 0x31f8);
*(float *)(this + 0x31f8) = (float)lVar7 + fVar8;
}
if (fVar8 != *(float *)(this + 0x31f4)) {
(**(code **)(*(int *)(this + 0x31f0) + 4))(this + 0x31f0,this + 0x31f4);
*(float *)(this + 0x31f4) = fVar8;
}
}
*(undefined4 *)(this + 0x3218) = 0xffffffff;
}
else {
if (*(float *)(this + 0x490) != 0.99) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x490) = 0x3f7d70a4;
}
CancelStagger(this);
iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
if (((((iVar5 == 3) && (iVar5 = (**(code **)(*(int *)this + 0x544))(this), iVar5 == 3)) &&
(uVar2 = *(uint *)(this + 0x30bc), uVar2 != 0xffffffff)) &&
((puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)))) &&
(*(CBaseAbility **)(puVar6 + 4) != (CBaseAbility *)0x0)) {
CBaseAbility::StartActivationTimer
(*(CBaseAbility **)(puVar6 + 4),*(float *)(ZombiePounceCrouchDelay._28_4_ + 0x2c),
0.0);
return;
}
}
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.