CBaseAchievement::IncrementCount
0x003fd230 · 380 bytes · __thiscall
_ZN16CBaseAchievement14IncrementCountEv.part.31
Decompiled
undefined (1 param)
/* CBaseAchievement::IncrementCount() [clone .part.31] */
void __thiscall CBaseAchievement::IncrementCount(CBaseAchievement *this)
{
undefined4 uVar1;
char cVar2;
CBaseAchievement *in_EAX;
uint uVar3;
undefined4 uVar4;
int iVar5;
undefined4 uVar6;
int in_GS_OFFSET;
longdouble lVar7;
char local_420 [1024];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
*(int *)(in_EAX + 0x60) = *(int *)(in_EAX + 0x60) + 1;
uVar3 = (**(code **)(*(int *)in_EAX + 0x24))();
if ((uVar3 & 0x80) != 0) {
*(undefined1 *)(*(int *)(in_EAX + 0x70) + 0x2ac + *(int *)(in_EAX + 0x74)) = 1;
}
if (*(int *)(cc_achievement_debug._28_4_ + 0x30) != 0) {
uVar4 = *(undefined4 *)(in_EAX + 0x1c);
uVar1 = *(undefined4 *)(in_EAX + 0x60);
uVar6 = (**(code **)(*(int *)in_EAX + 0x20))();
Msg("Achievement count increased for %s: %d/%d\n",uVar6,uVar1,uVar4);
}
if ((in_EAX[0x2d] != (CBaseAchievement)0x0) && (*(int *)(steamapicontext + 0x18) != 0)) {
uVar4 = (**(code **)(*(int *)in_EAX + 0x20))();
V_snprintf(local_420,0x400,"%s_STAT",uVar4);
cVar2 = (**(code **)(**(int **)(steamapicontext + 0x18) + 0xc))
(*(int **)(steamapicontext + 0x18),local_420,*(undefined4 *)(in_EAX + 0x60));
if (cVar2 == '\0') {
DevMsg("ISteamUserStats::GetStat failed to set progress value in Steam for achievement %s\n",
local_420);
}
iVar5 = *(int *)(in_EAX + 0x70);
if (*(float *)(iVar5 + 0x2b4) != 0.0) {
lVar7 = (longdouble)Plat_FloatTime();
iVar5 = *(int *)(in_EAX + 0x70);
if ((float)lVar7 - *(float *)(iVar5 + 0x2b4) <= 900.0) goto LAB_003fd2f9;
}
CAchievementMgr::UploadUserData(iVar5);
}
LAB_003fd2f9:
if (0 < *(int *)(in_EAX + 0x1c)) {
if (*(int *)(in_EAX + 0x60) < *(int *)(in_EAX + 0x1c)) {
HandleProgressUpdate(in_EAX);
}
else {
AwardAchievement(in_EAX);
}
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.