CTerrorPlayer::Cough
0x0099a3d0 · 461 bytes · __thiscall
_ZN13CTerrorPlayer5CoughEP11CBasePlayer
Decompiled
undefined (2 params)
/* CTerrorPlayer::Cough(CBasePlayer*) */
void __thiscall CTerrorPlayer::Cough(CTerrorPlayer *this,CBasePlayer *param_1)
{
char cVar1;
int iVar2;
undefined4 *puVar3;
longdouble lVar4;
float fVar5;
iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
cVar1 = IsASurvivorTeam(iVar2);
if (cVar1 != '\0') {
if (this[0x2f68] == (CTerrorPlayer)0x0) {
fVar5 = *(float *)(this + 0x2f74);
this[0x2f68] = (CTerrorPlayer)0x1;
lVar4 = (longdouble)CountdownTimer::Now();
fVar5 = fVar5 - (float)lVar4;
if (fVar5 <= 0.0) {
fVar5 = 0.0;
}
lVar4 = (longdouble)RandomFloat(fVar5,0x3f800000);
fVar5 = (float)lVar4;
lVar4 = (longdouble)CountdownTimer::Now();
if ((float)lVar4 + fVar5 != *(float *)(this + 0x2f74)) {
(**(code **)(*(int *)(this + 0x2f6c) + 4))(this + 0x2f6c,this + 0x2f74);
*(float *)(this + 0x2f74) = (float)lVar4 + fVar5;
}
if (fVar5 != *(float *)(this + 0x2f70)) {
(**(code **)(*(int *)(this + 0x2f6c) + 4))(this + 0x2f6c,this + 0x2f70);
*(float *)(this + 0x2f70) = fVar5;
}
}
if ((param_1 == (CBasePlayer *)0x0) ||
(cVar1 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar1 == '\0')) {
*(undefined4 *)(this + 0x3288) = 0xffffffff;
}
else {
puVar3 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0x3288) = *puVar3;
}
lVar4 = (longdouble)CountdownTimer::Now();
if ((float)lVar4 + 1.1 != *(float *)(this + 0x3284)) {
(**(code **)(*(int *)(this + 0x327c) + 4))(this + 0x327c,this + 0x3284);
*(float *)(this + 0x3284) = (float)lVar4 + 1.1;
}
if (*(float *)(this + 0x3280) != 1.1) {
(**(code **)(*(int *)(this + 0x327c) + 4))(this + 0x327c,this + 0x3280);
*(undefined4 *)(this + 0x3280) = 0x3f8ccccd;
}
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.