CBasePlayer::CheckTimeBasedDamage
0x007ae250 · 446 bytes · __thiscall
_ZN11CBasePlayer20CheckTimeBasedDamageEv
Decompiled
undefined (1 param)
/* CBasePlayer::CheckTimeBasedDamage() */
void __thiscall CBasePlayer::CheckTimeBasedDamage(CBasePlayer *this)
{
char cVar1;
CBasePlayer CVar2;
uint uVar3;
int iVar4;
int iVar5;
uint uVar6;
CBasePlayer local_24;
cVar1 = (**(code **)(*g_pGameRules + 0x44))(g_pGameRules,*(undefined4 *)(this + 0x1d54));
if ((cVar1 != '\0') && (2.0 <= ABS(*(float *)(gpGlobals + 0xc) - *(float *)(this + 0x1d88)))) {
*(float *)(this + 0x1d88) = *(float *)(gpGlobals + 0xc);
iVar5 = 0;
do {
while( true ) {
uVar6 = 0x8000 << ((byte)iVar5 & 0x1f);
cVar1 = (**(code **)(*g_pGameRules + 0x44))(g_pGameRules,uVar6);
if ((cVar1 != '\0') && ((*(uint *)(this + 0x1d54) & uVar6) != 0)) break;
LAB_007ae330:
iVar5 = iVar5 + 1;
if (iVar5 == 8) {
return;
}
}
local_24 = (CBasePlayer)0x2;
uVar3 = 1 << ((byte)iVar5 & 0x1f);
if ((uVar3 & 0xeb) == 0) {
if ((uVar3 & 4) == 0) {
local_24 = (CBasePlayer)0x0;
if ((uVar3 & 0x10) != 0) {
local_24 = (CBasePlayer)0x4;
if (*(int *)(this + 0x1d90) < *(int *)(this + 0x1d8c)) {
iVar4 = *(int *)(this + 0x1d8c) - *(int *)(this + 0x1d90);
local_24 = (CBasePlayer)0x4;
if (10 < iVar4) {
iVar4 = 10;
}
(**(code **)(*(int *)this + 0x128))(this,(float)iVar4,0);
*(int *)(this + 0x1d90) = *(int *)(this + 0x1d90) + iVar4;
}
}
}
else {
local_24 = (CBasePlayer)0x9;
if (*(int *)(this + 0x1d98) < *(int *)(this + 0x1d94)) {
iVar4 = *(int *)(this + 0x1d94) - *(int *)(this + 0x1d98);
if (10 < iVar4) {
iVar4 = 10;
}
(**(code **)(*(int *)this + 0x128))(this,(float)iVar4,0);
local_24 = (CBasePlayer)0x9;
*(int *)(this + 0x1d98) = *(int *)(this + 0x1d98) + iVar4;
}
}
}
if (this[iVar5 + 0x1d9c] != (CBasePlayer)0x0) {
CVar2 = (CBasePlayer)((char)this[iVar5 + 0x1d9c] + -1);
if (CVar2 == (CBasePlayer)0x0) {
this[iVar5 + 0x1d9c] = (CBasePlayer)0x0;
*(uint *)(this + 0x1d54) = *(uint *)(this + 0x1d54) & ~uVar6;
}
else {
this[iVar5 + 0x1d9c] = CVar2;
}
goto LAB_007ae330;
}
this[iVar5 + 0x1d9c] = local_24;
iVar5 = iVar5 + 1;
} while (iVar5 != 8);
}
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.