ScalarDeltaMeter::UpdateMeterMax
0x008ed1b0 · 1003 bytes · __thiscall
_ZN16ScalarDeltaMeter14UpdateMeterMaxEffbb
Decompiled
undefined (5 params)
/* ScalarDeltaMeter::UpdateMeterMax(float, float, bool, bool) */
longdouble __thiscall
ScalarDeltaMeter::UpdateMeterMax
(ScalarDeltaMeter *this,float param_1,float param_2,bool param_3,bool param_4)
{
float fVar1;
longdouble lVar2;
float fVar3;
float fVar4;
float local_24;
fVar1 = *(float *)this;
if (param_4) {
if (fVar1 <= param_1) {
LAB_008ed2b9:
fVar4 = *(float *)(this + 0x10);
fVar3 = param_2;
if (param_3) {
lVar2 = (longdouble)CountdownTimer::Now();
if (fVar4 - (float)lVar2 <= param_2) {
fVar4 = *(float *)(this + 0x10);
lVar2 = (longdouble)CountdownTimer::Now();
if (0.0 <= fVar4 - (float)lVar2) {
fVar4 = *(float *)(this + 0x10);
lVar2 = (longdouble)CountdownTimer::Now();
fVar3 = fVar4 - (float)lVar2;
goto LAB_008ed2fc;
}
fVar3 = 0.0;
if (param_2 != 0.0) goto LAB_008ed305;
LAB_008ed545:
fVar4 = 1.0;
}
else {
LAB_008ed2fc:
if (param_2 == 0.0) goto LAB_008ed540;
LAB_008ed305:
fVar3 = fVar3 / param_2;
fVar4 = fVar3 * fVar3 * 3.0 - (fVar3 + fVar3) * fVar3 * fVar3;
}
}
else {
lVar2 = (longdouble)CountdownTimer::Now();
if (fVar4 - (float)lVar2 <= param_2) {
fVar4 = *(float *)(this + 0x10);
lVar2 = (longdouble)CountdownTimer::Now();
if (0.0 <= fVar4 - (float)lVar2) {
fVar4 = *(float *)(this + 0x10);
lVar2 = (longdouble)CountdownTimer::Now();
fVar3 = fVar4 - (float)lVar2;
goto LAB_008ed37a;
}
fVar3 = 0.0;
if (param_2 == 0.0) goto LAB_008ed545;
LAB_008ed383:
fVar4 = fVar3 / param_2;
}
else {
LAB_008ed37a:
if (param_2 != 0.0) goto LAB_008ed383;
LAB_008ed540:
fVar4 = 0.0;
if (0.0 <= fVar3) goto LAB_008ed545;
}
}
*(float *)this = fVar4;
if (param_4) {
fVar4 = 1.0 - fVar4;
}
goto LAB_008ed401;
}
if (param_1 <= 0.0) {
param_1 = 0.0;
}
if (1.0 <= param_1) {
param_1 = 1.0;
}
*(float *)this = param_1;
local_24 = (1.0 - param_1) * param_2;
lVar2 = (longdouble)CountdownTimer::Now();
if ((float)lVar2 + local_24 != *(float *)(this + 0x10)) {
(**(code **)(*(int *)(this + 8) + 4))(this + 8,this + 0x10);
*(float *)(this + 0x10) = (float)lVar2 + local_24;
}
if (local_24 == *(float *)(this + 0xc)) {
LAB_008ed3fd:
fVar4 = *(float *)this;
goto LAB_008ed401;
}
}
else {
if (param_1 <= fVar1) goto LAB_008ed2b9;
if (param_1 <= 0.0) {
param_1 = 0.0;
}
if (1.0 <= param_1) {
param_1 = 1.0;
}
*(float *)this = param_1;
local_24 = param_1 * param_2;
lVar2 = (longdouble)CountdownTimer::Now();
if ((float)lVar2 + local_24 != *(float *)(this + 0x10)) {
(**(code **)(*(int *)(this + 8) + 4))(this + 8,this + 0x10);
*(float *)(this + 0x10) = (float)lVar2 + local_24;
}
if (local_24 == *(float *)(this + 0xc)) goto LAB_008ed3fd;
}
(**(code **)(*(int *)(this + 8) + 4))(this + 8,this + 0xc);
fVar4 = *(float *)this;
*(float *)(this + 0xc) = local_24;
LAB_008ed401:
if (fVar4 <= 0.0) {
fVar4 = 0.0;
}
if (1.0 <= fVar4) {
fVar4 = 1.0;
}
*(float *)this = fVar4;
return (longdouble)(fVar4 - fVar1);
}
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.