CAchievementSaveRestoreBlockHandler::Save
0x003ed1a0 · 434 bytes · __thiscall
_ZN35CAchievementSaveRestoreBlockHandler4SaveEP5ISave
Decompiled
undefined (2 params)
/* CAchievementSaveRestoreBlockHandler::Save(ISave*) */
void __thiscall
CAchievementSaveRestoreBlockHandler::Save(CAchievementSaveRestoreBlockHandler *this,ISave *param_1)
{
code *pcVar1;
char cVar2;
int iVar3;
int *piVar4;
int *piVar5;
undefined4 uVar6;
int iVar7;
short local_20;
undefined2 local_1e [7];
iVar3 = (**(code **)(*engine + 0x1a4))(engine);
if (iVar3 != 0) {
piVar4 = (int *)__dynamic_cast(iVar3,&IAchievementMgr::typeinfo,&CAchievementMgr::typeinfo,0x1c)
;
if (piVar4 != (int *)0x0) {
(**(code **)(*piVar4 + 100))(piVar4);
(**(code **)(*(int *)param_1 + 0x1c))(param_1,"Achievements");
iVar3 = (**(code **)(*piVar4 + 0x5c))(piVar4,0);
local_20 = 0;
if (iVar3 < 1) {
(**(code **)(*(int *)param_1 + 0x28))(param_1,&local_20,1);
}
else {
iVar7 = 0;
do {
piVar5 = (int *)(**(code **)(*piVar4 + 0x50))(piVar4,iVar7,0);
cVar2 = (**(code **)(*piVar5 + 0x20))(piVar5);
if (cVar2 != '\0') {
local_20 = local_20 + 1;
}
iVar7 = iVar7 + 1;
} while (iVar7 != iVar3);
(**(code **)(*(int *)param_1 + 0x28))(param_1,&local_20,1);
iVar7 = 0;
do {
piVar5 = (int *)(**(code **)(*piVar4 + 0x50))(piVar4,iVar7,0);
cVar2 = (**(code **)(*piVar5 + 0x20))(piVar5);
if (cVar2 != '\0') {
piVar5 = (int *)__dynamic_cast(piVar5,&IAchievement::typeinfo,
&CBaseAchievement::typeinfo,0xc);
if (piVar5 != (int *)0x0) {
local_1e[0] = (**(code **)(*piVar5 + 0x1c))(piVar5);
(**(code **)(*(int *)param_1 + 0x28))(param_1,local_1e,1);
pcVar1 = *(code **)(*(int *)param_1 + 0x14);
uVar6 = (**(code **)(*piVar5 + 0xb0))(piVar5);
(*pcVar1)(param_1,piVar5,uVar6);
}
}
iVar7 = iVar7 + 1;
} while (iVar7 != iVar3);
}
(**(code **)(*(int *)param_1 + 0x24))(param_1);
}
}
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.