L L4D2node

CBaseCombatCharacter::GiveAmmo

0x005f4fa0 · 109 bytes · __cdecl

_ZN20CBaseCombatCharacter8GiveAmmoEiPKcb

Decompiled

undefined (3 params)

/* CBaseCombatCharacter::GiveAmmo(int, char const*, bool) */

undefined4 CBaseCombatCharacter::GiveAmmo(int param_1,char *param_2,bool param_3)

{
  CAmmoDef *this;
  int iVar1;
  undefined4 uVar2;
  undefined3 in_stack_0000000d;
  
  this = (CAmmoDef *)GetAmmoDef();
  iVar1 = CAmmoDef::Index(this,_param_3);
  if (iVar1 != -1) {
                    /* WARNING: Could not recover jumptable at 0x005f4ff1. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    uVar2 = (**(code **)(*(int *)param_1 + 0x44c))();
    return uVar2;
  }
  Msg("ERROR: Attempting to give unknown ammo type (%s)\n",_param_3);
  return 0;
}

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)