CAchievementMgr::LevelInitPreEntity
0x003e9d10 · 612 bytes · __thiscall
_ZN15CAchievementMgr18LevelInitPreEntityEv
Decompiled
undefined (1 param)
/* CAchievementMgr::LevelInitPreEntity() */
void __thiscall CAchievementMgr::LevelInitPreEntity(CAchievementMgr *this)
{
char cVar1;
ushort uVar2;
char *pcVar3;
int iVar4;
uint uVar5;
CUtlVector<CBaseAchievement*,CUtlMemory<CBaseAchievement*,int>> *this_00;
CUtlRBTree<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,CBaseAchievement*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*this_01;
int local_30;
CBaseAchievement *local_20 [4];
iVar4 = gpGlobals;
*(undefined4 *)(this + 0xcc) = 0;
*(undefined4 *)(this + 0xf4) = 0;
this_01 = (CUtlRBTree<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,CBaseAchievement*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(this + 0x38);
*(undefined4 *)(this + 0x11c) = 0;
*(undefined4 *)(this + 0x2c8) = 0;
*(undefined4 *)(this + 400) = 0;
*(undefined4 *)(this + 0x198) = 0;
*(undefined4 *)(this + 0x1a0) = 0;
*(undefined4 *)(this + 0xe0) = 0;
*(undefined4 *)(this + 0x108) = 0;
*(undefined4 *)(this + 0x130) = 0;
*(undefined4 *)(this + 0x2dc) = 0;
*(undefined4 *)(this + 0x194) = 0;
*(undefined4 *)(this + 0x19c) = 0;
*(undefined4 *)(this + 0x1a4) = 0;
pcVar3 = "";
if (*(char **)(iVar4 + 0x3c) != (char *)0x0) {
pcVar3 = *(char **)(iVar4 + 0x3c);
}
V_strncpy((char *)(this + 0x1a8),pcVar3,0x104);
this_00 = (CUtlVector<CBaseAchievement*,CUtlMemory<CBaseAchievement*,int>> *)(this + 0x110);
local_30 = 0;
do {
if (this[local_30 + 0x2ae] != (CAchievementMgr)0x0) {
uVar2 = CUtlRBTree<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,CBaseAchievement*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::FirstInorder(this_01);
for (; uVar2 != 0xffff;
uVar2 = CUtlRBTree<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,CBaseAchievement*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::NextInorder(this_01,uVar2)) {
local_20[0] = *(CBaseAchievement **)((uint)uVar2 * 0x10 + *(int *)(this_01 + 4) + 0xc);
if ((*(char **)(local_20[0] + 0x40) == (char *)0x0) ||
(iVar4 = _V_strcmp((char *)(this + 0x1a8),*(char **)(local_20[0] + 0x40)), iVar4 == 0)) {
uVar5 = (**(code **)(*(int *)local_20[0] + 0x24))(local_20[0]);
if ((uVar5 & 1) == 0) {
uVar5 = (**(code **)(*(int *)local_20[0] + 0x24))(local_20[0]);
if ((uVar5 & 2) != 0) goto LAB_003e9efb;
LAB_003e9e53:
uVar5 = (**(code **)(*(int *)local_20[0] + 0x24))(local_20[0]);
if ((uVar5 & 4) != 0) goto LAB_003e9f27;
LAB_003e9e66:
cVar1 = (**(code **)(*(int *)local_20[0] + 0x54))(local_20[0]);
}
else {
CUtlVector<CBaseAchievement*,CUtlMemory<CBaseAchievement*,int>>::InsertBefore
(this_00 + -0x50,*(int *)(this_00 + -0x44),local_20);
uVar5 = (**(code **)(*(int *)local_20[0] + 0x24))(local_20[0]);
if ((uVar5 & 2) == 0) goto LAB_003e9e53;
LAB_003e9efb:
CUtlVector<CBaseAchievement*,CUtlMemory<CBaseAchievement*,int>>::InsertBefore
(this_00 + -0x28,*(int *)(this_00 + -0x1c),local_20);
uVar5 = (**(code **)(*(int *)local_20[0] + 0x24))(local_20[0]);
if ((uVar5 & 4) == 0) goto LAB_003e9e66;
LAB_003e9f27:
CUtlVector<CBaseAchievement*,CUtlMemory<CBaseAchievement*,int>>::InsertBefore
(this_00,*(int *)(this_00 + 0xc),local_20);
cVar1 = (**(code **)(*(int *)local_20[0] + 0x54))(local_20[0]);
}
if (cVar1 != '\0') {
(**(code **)(*(int *)local_20[0] + 0x14))(local_20[0]);
}
}
}
*(undefined4 *)(this + local_30 * 4 + 0x188) = *(undefined4 *)(gpGlobals + 0xc);
}
local_30 = local_30 + 1;
this_01 = this_01 + 0x1c;
this_00 = this_00 + 0x14;
if (local_30 == 2) {
return;
}
} while( true );
}
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.