L L4D2node

CalculateDefaultPhysicsDamage

0x0078ae10 · 199 bytes · __cdecl

_Z29CalculateDefaultPhysicsDamageiP21gamevcollisionevent_tfbRi8string_tb

Decompiled

undefined (7 params)

/* CalculateDefaultPhysicsDamage(int, gamevcollisionevent_t*, float, bool, int&, string_t, bool) */

void CalculateDefaultPhysicsDamage
               (int param_1,gamevcollisionevent_t *param_2,undefined1 *param_3,bool param_4,
               int *param_5,char *param_6,bool param_7)

{
  float fVar1;
  int iVar2;
  int iVar3;
  
  fVar1 = (float)param_3;
  if (param_6 != (char *)0x0) {
    iVar3 = 0;
    do {
      iVar2 = _V_strcmp((&gDamageTableRegistry)[iVar3 * 2],param_6);
      if (iVar2 == 0) {
        param_3 = (&PTR_gDefaultPlayerImpactDamageTable_00cb1f64)[iVar3 * 2];
        goto LAB_0078ae98;
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 != 4);
    Warning("Failed to find custom physics damage table name: %s\n",param_6);
  }
  param_3 = gDefaultNPCImpactDamageTable;
LAB_0078ae98:
  CalculatePhysicsImpactDamage
            (param_1,param_2,(impactdamagetable_t *)param_3,fVar1,param_4,param_5,param_7);
  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)