CSave::WriteFields
0x004a90c0 · 280 bytes · __thiscall
_ZN5CSave11WriteFieldsEPKcPKvP9datamap_tP17typedescription_ti
Decompiled
undefined (6 params)
/* CSave::WriteFields(char const*, void const*, datamap_t*, typedescription_t*, int) */
undefined4 __thiscall
CSave::WriteFields(CSave *this,char *param_1,void *param_2,datamap_t *param_3,
typedescription_t *param_4,int param_5)
{
int iVar1;
int iVar2;
char cVar3;
int iVar4;
int iVar5;
int iVar6;
int local_20 [4];
iVar5 = 0;
local_20[0] = -1;
iVar1 = *(int *)(*(int *)(this + 0x18) + 8);
(**(code **)(*(int *)this + 0x58))(this,param_1,local_20,1);
local_20[0] = 0;
if (0 < param_5) {
do {
while( true ) {
iVar2 = *(int *)(param_4 + 8);
cVar3 = ShouldSaveField(this,(void *)((int)param_2 + iVar2),param_4);
if (cVar3 == '\0') break;
cVar3 = WriteField(this,param_1,(void *)((int)param_2 + iVar2),param_3,param_4);
if (cVar3 == '\0') goto LAB_004a9174;
local_20[0] = local_20[0] + 1;
iVar5 = iVar5 + 1;
param_4 = param_4 + 0x40;
if (iVar5 == param_5) goto LAB_004a9174;
}
iVar5 = iVar5 + 1;
param_4 = param_4 + 0x40;
} while (iVar5 != param_5);
}
LAB_004a9174:
iVar5 = *(int *)(this + 0x18);
iVar2 = *(int *)(iVar5 + 8);
iVar6 = iVar2 - iVar1;
iVar4 = iVar2;
if (iVar6 <= iVar2) {
iVar4 = iVar6;
}
*(int *)(iVar5 + 4) = *(int *)(iVar5 + 4) - iVar4;
*(int *)(iVar5 + 8) = iVar2 - iVar4;
(**(code **)(*(int *)this + 0x58))(this,param_1,local_20,1);
iVar5 = *(int *)(this + 0x18);
iVar6 = iVar6 + (iVar1 - *(int *)(iVar5 + 8));
*(int *)(iVar5 + 4) = *(int *)(iVar5 + 4) + iVar6;
*(int *)(iVar5 + 8) = iVar6 + *(int *)(iVar5 + 8);
return 1;
}
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.