CForgetfulAwardTemplate::CheckAndResetTimer
0x0084f750 · 338 bytes · __thiscall
_ZN23CForgetfulAwardTemplate18CheckAndResetTimerEv
Decompiled
undefined (1 param)
/* CForgetfulAwardTemplate::CheckAndResetTimer() */
void __thiscall CForgetfulAwardTemplate::CheckAndResetTimer(CForgetfulAwardTemplate *this)
{
int iVar1;
char cVar2;
int *piVar3;
int iVar4;
longdouble lVar5;
piVar3 = (int *)CAwardTemplate::GetOwner((CAwardTemplate *)this);
if (piVar3 != (int *)0x0) {
iVar1 = piVar3[0x40];
lVar5 = (longdouble)(**(code **)(*piVar3 + 0x7e4))(piVar3);
iVar4 = 0;
cVar2 = (**(code **)(*piVar3 + 0x7e8))(piVar3);
if (cVar2 == '\0') {
iVar4 = (int)((float)lVar5 + (float)iVar1);
}
if (0.0 < *(float *)(this + 0x14)) {
lVar5 = (longdouble)IntervalTimer::Now();
if ((10.0 <= (float)lVar5 - *(float *)(this + 0x14)) &&
((float)iVar4 < *(float *)(SurvivorLimpHealth._28_4_ + 0x2c))) {
cVar2 = DoesOwnerHaveHealthItem(this);
if (cVar2 != '\0') {
this[0x18] = (CForgetfulAwardTemplate)0x1;
}
}
}
cVar2 = DoesOwnerHaveHealthItem(this);
if ((cVar2 == '\0') || (*(float *)(SurvivorLimpHealth._28_4_ + 0x2c) <= (float)iVar4)) {
if (*(float *)(this + 0x14) != -1.0) {
(**(code **)(*(int *)(this + 0x10) + 4))(this + 0x10,this + 0x14);
*(undefined4 *)(this + 0x14) = 0xbf800000;
return;
}
}
else {
lVar5 = (longdouble)IntervalTimer::Now();
if ((float)lVar5 != *(float *)(this + 0x14)) {
(**(code **)(*(int *)(this + 0x10) + 4))(this + 0x10,this + 0x14);
*(float *)(this + 0x14) = (float)lVar5;
}
}
}
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.