L L4D2node

L4D_Weapon_Stat_Data::SaveStatsToKeyValue

0x008e0240 · 97 bytes · __thiscall

_ZNK20L4D_Weapon_Stat_Data19SaveStatsToKeyValueEP9KeyValues

Decompiled

undefined (2 params)

/* L4D_Weapon_Stat_Data::SaveStatsToKeyValue(KeyValues*) const */

void __thiscall
L4D_Weapon_Stat_Data::SaveStatsToKeyValue(L4D_Weapon_Stat_Data *this,KeyValues *param_1)

{
  int iVar1;
  undefined **ppuVar2;
  char *pcVar3;
  int iVar4;
  
  iVar4 = 0;
  do {
    iVar1 = iVar4 * 4;
    ppuVar2 = &L4D_STATS::WeaponDataTitle + iVar4;
    iVar4 = iVar4 + 1;
    KeyValues::SetInt(param_1,*ppuVar2,*(int *)(this + iVar1));
  } while (iVar4 != 5);
  pcVar3 = "";
  if (*(char **)(gpGlobals + 0x3c) != (char *)0x0) {
    pcVar3 = *(char **)(gpGlobals + 0x3c);
  }
  KeyValues::SetString(param_1,"MapID",pcVar3);
  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)