L L4D2node

CMeleeWeaponInfoStore::RegisterMeleeWeaponType

0x00544ec0 · 155 bytes · __thiscall

_ZN21CMeleeWeaponInfoStore23RegisterMeleeWeaponTypeEPKcP9KeyValues

Decompiled

undefined (3 params)

/* CMeleeWeaponInfoStore::RegisterMeleeWeaponType(char const*, KeyValues*) */

void __thiscall
CMeleeWeaponInfoStore::RegisterMeleeWeaponType
          (CMeleeWeaponInfoStore *this,char *param_1,KeyValues *param_2)

{
  undefined4 uVar1;
  int iVar2;
  CMeleeWeaponInfo *this_00;
  undefined4 local_24;
  CMeleeWeaponInfo *local_20;
  
  if ((param_1 != (char *)0x0) && (param_2 != (KeyValues *)0x0)) {
    uVar1 = HandleForWeaponName(this,param_1,true);
    local_24 = uVar1;
    iVar2 = CUtlRBTree<CUtlMap<int,CMeleeWeaponInfo*,int>::Node_t,int,CUtlMap<int,CMeleeWeaponInfo*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CMeleeWeaponInfo*,int>::Node_t,int>,int>>
            ::Find((CUtlRBTree<CUtlMap<int,CMeleeWeaponInfo*,int>::Node_t,int,CUtlMap<int,CMeleeWeaponInfo*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CMeleeWeaponInfo*,int>::Node_t,int>,int>>
                    *)(this + 0xc),(Node_t *)&local_24);
    if (iVar2 == -1) {
      this_00 = ::operator_new(0xca0);
                    /* try { // try from 00544f40 to 00544f44 has its CatchHandler @ 00544f63 */
      CMeleeWeaponInfo::CMeleeWeaponInfo(this_00,param_1,param_2);
      if (this_00 != (CMeleeWeaponInfo *)0x0) {
        local_24 = uVar1;
        local_20 = this_00;
        CUtlRBTree<CUtlMap<int,CMeleeWeaponInfo*,int>::Node_t,int,CUtlMap<int,CMeleeWeaponInfo*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CMeleeWeaponInfo*,int>::Node_t,int>,int>>
        ::Insert((CUtlRBTree<CUtlMap<int,CMeleeWeaponInfo*,int>::Node_t,int,CUtlMap<int,CMeleeWeaponInfo*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CMeleeWeaponInfo*,int>::Node_t,int>,int>>
                  *)(this + 0xc),(Node_t *)&local_24);
      }
    }
  }
  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)