L L4D2node

CTerrorWeaponInfo::Parse

0x00575050 · 1891 bytes · __thiscall

_ZN17CTerrorWeaponInfo5ParseEP9KeyValuesPKc

Decompiled

undefined (3 params)

/* CTerrorWeaponInfo::Parse(KeyValues*, char const*) */

void __thiscall CTerrorWeaponInfo::Parse(CTerrorWeaponInfo *this,KeyValues *param_1,char *param_2)

{
  ushort uVar1;
  undefined4 uVar2;
  char *pcVar3;
  KeyValues *pKVar4;
  char *pcVar5;
  size_t sVar6;
  char *__dest;
  int iVar7;
  longdouble lVar8;
  char *local_24;
  char *local_20;
  
  CCSWeaponInfo::Parse((CCSWeaponInfo *)this,param_1,param_2);
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"VerticalPunch",*(float *)(this + 0xc04));
  *(float *)(this + 0xc04) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"HorizontalPunch",*(float *)(this + 0xc08));
  *(float *)(this + 0xc08) = (float)lVar8;
  lVar8 = (longdouble)
          KeyValues::GetFloat(param_1,"HorizontalPunchDirChance",*(float *)(this + 0xc0c));
  *(float *)(this + 0xc0c) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"SpreadPerShot",*(float *)(this + 0xc10));
  *(float *)(this + 0xc10) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"MaxSpread",*(float *)(this + 0xc14));
  *(float *)(this + 0xc14) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"SpreadDecay",*(float *)(this + 0xc18));
  *(float *)(this + 0xc18) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"MinDuckingSpread",*(float *)(this + 0xc1c));
  *(float *)(this + 0xc1c) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"MinStandingSpread",*(float *)(this + 0xc20));
  *(float *)(this + 0xc20) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"MinInAirSpread",*(float *)(this + 0xc24));
  *(float *)(this + 0xc24) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"MaxMovementSpread",*(float *)(this + 0xc28));
  *(float *)(this + 0xc28) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"PelletScatterPitch",*(float *)(this + 0xc2c));
  *(float *)(this + 0xc2c) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"PelletScatterYaw",*(float *)(this + 0xc30));
  *(float *)(this + 0xc30) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"ReloadDuration",*(float *)(this + 0xc38));
  *(float *)(this + 0xc38) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"DualReloadDuration",*(float *)(this + 0xc3c));
  *(float *)(this + 0xc3c) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"DeployDuration",*(float *)(this + 0xc40));
  *(float *)(this + 0xc40) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"DualDeployDuration",*(float *)(this + 0xc44));
  *(float *)(this + 0xc44) = (float)lVar8;
  lVar8 = (longdouble)
          KeyValues::GetFloat(param_1,"PenetrationNumLayers",(float)*(int *)(this + 0xc48));
  *(int *)(this + 0xc48) = (int)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"PenetrationPower",*(float *)(this + 0xc4c));
  *(float *)(this + 0xc4c) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"PenetrationMaxDistance",*(float *)(this + 0xc50))
  ;
  *(float *)(this + 0xc50) = (float)lVar8;
  lVar8 = (longdouble)
          KeyValues::GetFloat(param_1,"CharacterPenetrationMaxDistance",*(float *)(this + 0xc54));
  *(float *)(this + 0xc54) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"GainRange",*(float *)(this + 0xc58));
  *(float *)(this + 0xc58) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"MaxAutoAimDeflection1",*(float *)(this + 0xbf8));
  *(float *)(this + 0xbf8) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"MaxAutoAimRange1",*(float *)(this + 0xbfc));
  *(float *)(this + 0xbfc) = (float)lVar8;
  lVar8 = (longdouble)KeyValues::GetFloat(param_1,"WeaponAutoAimScale",*(float *)(this + 0xc00));
  *(float *)(this + 0xc00) = (float)lVar8;
  uVar2 = KeyValues::GetInt(param_1,"LoadoutSlots",*(int *)(this + 0xbf4));
  *(undefined4 *)(this + 0xbf4) = uVar2;
  pcVar3 = (char *)KeyValues::GetString(param_1,"viewmodel_dual","");
  V_strncpy((char *)(this + 0xc78),pcVar3,0x50);
  pcVar3 = (char *)KeyValues::GetString(param_1,"playermodel_dual","");
  V_strncpy((char *)(this + 0xcc8),pcVar3,0x50);
  pcVar3 = (char *)KeyValues::GetString(param_1,"AddonAttachment","");
  V_strncpy((char *)(this + 0xd18),pcVar3,0x50);
  pcVar3 = (char *)KeyValues::GetString(param_1,"worldmodel","");
  V_strncpy((char *)(this + 0xd80),pcVar3,0x50);
  RemoveViewmodels(this);
  pKVar4 = (KeyValues *)KeyValues::FindKey(param_1,"CharacterViewmodelAddon",false);
  if ((pKVar4 != (KeyValues *)0x0) &&
     (pKVar4 = (KeyValues *)KeyValues::GetFirstValue(pKVar4), pKVar4 != (KeyValues *)0x0)) {
    do {
      while( true ) {
        pcVar3 = (char *)KeyValues::GetName(pKVar4);
        pcVar5 = (char *)KeyValues::GetString(pKVar4,(char *)0x0,"");
        local_24 = pcVar3;
        uVar1 = CUtlRBTree<CUtlMap<char_const*,char_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,char_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,char_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                ::Find((CUtlRBTree<CUtlMap<char_const*,char_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,char_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,char_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                        *)(this + 0xc5c),(Node_t *)&local_24);
        if (uVar1 != 0xffff) break;
        sVar6 = strlen(pcVar5);
        __dest = operator_new__(sVar6 + 1);
        strcpy(__dest,pcVar5);
        sVar6 = strlen(pcVar3);
        pcVar5 = operator_new__(sVar6 + 1);
        strcpy(pcVar5,pcVar3);
        local_24 = pcVar5;
        local_20 = __dest;
        CUtlRBTree<CUtlMap<char_const*,char_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,char_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,char_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Insert((CUtlRBTree<CUtlMap<char_const*,char_const*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,char_const*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,char_const*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                  *)(this + 0xc5c),(Node_t *)&local_24);
        pKVar4 = (KeyValues *)KeyValues::GetNextValue(pKVar4);
        if (pKVar4 == (KeyValues *)0x0) goto LAB_00575773;
      }
      iVar7 = *(int *)(this + 0xc60) + (uint)uVar1 * 0x10;
      if (*(void **)(iVar7 + 0xc) != (void *)0x0) {
        operator_delete__(*(void **)(iVar7 + 0xc));
        iVar7 = (uint)uVar1 * 0x10 + *(int *)(this + 0xc60);
      }
      sVar6 = strlen(pcVar5);
      pcVar3 = operator_new__(sVar6 + 1);
      strcpy(pcVar3,pcVar5);
      *(char **)(iVar7 + 0xc) = pcVar3;
      pKVar4 = (KeyValues *)KeyValues::GetNextValue(pKVar4);
    } while (pKVar4 != (KeyValues *)0x0);
  }
LAB_00575773:
  ParseVector(param_1,"addon_offset",(Vector *)(this + 0xd68));
  ParseAngles(param_1,"addon_angles",(QAngle *)(this + 0xd74));
  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)