L L4D2node

CGameRules::GetAmmoDamage

0x0045ef10 · 91 bytes · __thiscall

_ZN10CGameRules13GetAmmoDamageEP11CBaseEntityS1_i

Decompiled

undefined (4 params)

/* CGameRules::GetAmmoDamage(CBaseEntity*, CBaseEntity*, int) */

longdouble __thiscall
CGameRules::GetAmmoDamage(CGameRules *this,CBaseEntity *param_1,CBaseEntity *param_2,int param_3)

{
  char cVar1;
  CAmmoDef *this_00;
  int iVar2;
  
  this_00 = (CAmmoDef *)GetAmmoDef();
  cVar1 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
  if (cVar1 == '\0') {
    iVar2 = CAmmoDef::NPCDamage(this_00,param_3);
    return (longdouble)iVar2;
  }
  iVar2 = CAmmoDef::PlrDamage(this_00,param_3);
  return (longdouble)iVar2;
}

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)