L L4D2node

GuessDamageForce

0x004c8840 · 137 bytes · __cdecl

_Z16GuessDamageForceP15CTakeDamageInfoRK6VectorS3_f

Decompiled

undefined (4 params)

/* GuessDamageForce(CTakeDamageInfo*, Vector const&, Vector const&, float) */

void GuessDamageForce(CTakeDamageInfo *param_1,Vector *param_2,Vector *param_3,float param_4)

{
  CAmmoDef *this;
  int iVar1;
  
  if ((*(uint *)(param_1 + 0x48) & 2) != 0) {
    this = (CAmmoDef *)GetAmmoDef();
    iVar1 = CAmmoDef::Index(this,"SMG1");
    CalculateBulletDamageForce(param_1,iVar1,param_2,param_3,param_4);
    return;
  }
  if ((*(uint *)(param_1 + 0x48) & 0x40) == 0) {
    CalculateMeleeDamageForce(param_1,param_2,param_3,param_4);
    return;
  }
  CalculateExplosiveDamageForce(param_1,param_2,param_3,param_4);
  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)