L L4D2node

CAchievementMgr::ClearAchievementData

0x003e94b0 · 182 bytes · __thiscall

_ZN15CAchievementMgr20ClearAchievementDataEi

Decompiled

undefined (2 params)

/* CAchievementMgr::ClearAchievementData(int) */

void __thiscall CAchievementMgr::ClearAchievementData(CAchievementMgr *this,int param_1)

{
  int *piVar1;
  uint uVar2;
  ushort *puVar3;
  int iVar4;
  int iVar5;
  
  iVar5 = 0;
  uVar2 = *(uint *)(this + param_1 * 0x1c + 0x40);
  if ((short)uVar2 != 0) {
    do {
      while (((int)uVar2 <= iVar5 || (*(ushort *)(this + param_1 * 0x1c + 0x4e) < (ushort)iVar5))) {
        iVar5 = iVar5 + 1;
        if ((int)(uVar2 & 0xffff) <= iVar5) {
          return;
        }
      }
      if ((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>>
           ::Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar4 = __cxa_guard_acquire(&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>>
                                       ::Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
        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>>
        ::Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f137de = 0xffff;
        DAT_00f137e0 = 0xffff;
        __cxa_guard_release(&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>>
                             ::Links(unsigned_short)::s_Sentinel);
      }
      puVar3 = (ushort *)(iVar5 * 0x10 + *(int *)(this + param_1 * 0x1c + 0x3c));
      if ((ushort)iVar5 != *puVar3) {
        piVar1 = *(int **)(puVar3 + 6);
        (**(code **)(*piVar1 + 0x8c))(piVar1);
      }
      uVar2 = *(uint *)(this + param_1 * 0x1c + 0x40);
      iVar5 = iVar5 + 1;
    } while (iVar5 < (int)(uVar2 & 0xffff));
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)