CLogicActiveAutosave::SaveThink
0x006ec540 · 419 bytes · __thiscall
_ZN20CLogicActiveAutosave9SaveThinkEv
Decompiled
undefined (1 param)
/* CLogicActiveAutosave::SaveThink() */
void __thiscall CLogicActiveAutosave::SaveThink(CLogicActiveAutosave *this)
{
int iVar1;
undefined1 *puVar2;
int iVar3;
float fVar4;
float fVar5;
inputdata_t local_2c [8];
float local_24;
undefined4 local_18;
undefined4 local_14;
iVar1 = UTIL_GetLocalPlayer();
iVar3 = gpGlobals;
fVar5 = *(float *)(this + 0x454);
if (iVar1 == 0) {
LAB_006ec69a:
if (0.0 <= fVar5) {
fVar4 = *(float *)(iVar3 + 0xc);
LAB_006ec658:
fVar5 = 0.5;
goto LAB_006ec660;
}
}
else if (fVar5 < 0.0) {
if (*(int *)(iVar1 + 0x100) <= *(int *)(this + 0x444)) {
fVar5 = *(float *)(gpGlobals + 0xc);
*(float *)(this + 0x454) = fVar5;
goto LAB_006ec69a;
}
}
else {
if (*(int *)(iVar1 + 0x100) < *(int *)(this + 0x44c)) {
fVar4 = *(float *)(gpGlobals + 0xc);
if ((0.0 < *(float *)(this + 0x450)) && (*(float *)(this + 0x450) < fVar4 - fVar5)) {
*(undefined4 *)(this + 0x454) = 0xbf800000;
fVar5 = 1.0;
fVar4 = *(float *)(iVar3 + 0xc);
goto LAB_006ec660;
}
goto LAB_006ec658;
}
local_24 = 0.0;
local_18 = 0xffffffff;
local_14 = 0;
if (*(int *)(this + 0x30) == 0) {
iVar3 = 0;
}
else {
iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
puVar2 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x154) != (undefined1 *)0x0) {
puVar2 = *(undefined1 **)(this + 0x154);
}
DevMsg(2,"logic_active_autosave (%s, %d) triggered\n",puVar2,iVar3);
if (*(float *)(this + 0x458) == 0.0) {
CLogicAutosave::InputSave((inputdata_t *)this);
}
else {
local_14 = 1;
local_24 = *(float *)(this + 0x458);
CLogicAutosave::InputSaveDangerous((CLogicAutosave *)this,local_2c);
}
*(undefined4 *)(this + 0x454) = 0xbf800000;
iVar3 = gpGlobals;
}
fVar4 = *(float *)(iVar3 + 0xc);
fVar5 = 1.0;
LAB_006ec660:
CBaseEntity::SetNextThink((CBaseEntity *)this,fVar4 + fVar5,(char *)0x0);
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.