Music::OnChargerAlert
0x008e9340 · 307 bytes · __thiscall
_ZN5Music14OnChargerAlertEif
Decompiled
undefined (3 params)
/* Music::OnChargerAlert(int, float) */
void __thiscall Music::OnChargerAlert(Music *this,int param_1,float param_2)
{
float fVar1;
float fVar2;
code *pcVar3;
longdouble lVar4;
fVar1 = *(float *)(this + 0x144);
pcVar3 = *(code **)(*(int *)this + 0x80);
lVar4 = (longdouble)CountdownTimer::Now();
lVar4 = (longdouble)(*pcVar3)(this,param_1,param_2,"Charger",fVar1 - (float)lVar4);
fVar1 = (float)lVar4;
if (0.0 <= fVar1) {
lVar4 = (longdouble)CountdownTimer::Now();
if ((float)lVar4 + fVar1 == *(float *)(this + 0x144)) {
fVar2 = *(float *)(this + 0x140);
}
else {
(**(code **)(*(int *)(this + 0x13c) + 4))(this + 0x13c,this + 0x144);
fVar2 = *(float *)(this + 0x140);
*(float *)(this + 0x144) = (float)lVar4 + fVar1;
}
if (fVar1 != fVar2) {
(**(code **)(*(int *)(this + 0x13c) + 4))(this + 0x13c,this + 0x140);
*(float *)(this + 0x140) = fVar1;
}
/* WARNING: Could not recover jumptable at 0x008e9403. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*(int *)this + 0xe4))();
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.