L L4D2node

CBaseEntity::GetAttackDamageScale

0x005ffbb0 · 160 bytes · __cdecl

_ZN11CBaseEntity20GetAttackDamageScaleEPS_

Decompiled

undefined (1 param)

/* CBaseEntity::GetAttackDamageScale(CBaseEntity*) */

longdouble CBaseEntity::GetAttackDamageScale(CBaseEntity *param_1)

{
  char cVar1;
  int iVar2;
  int iVar3;
  longdouble lVar4;
  float local_20;
  
  iVar2 = *(int *)(param_1 + 0x164);
  if (iVar2 == -1) {
    local_20 = 1.0;
  }
  else {
    iVar3 = *(int *)(param_1 + 0x158);
    local_20 = 1.0;
    do {
      while( true ) {
        cVar1 = CDamageModifier::IsDamageDoneToMe(*(CDamageModifier **)(iVar3 + iVar2 * 0xc));
        if (cVar1 != '\0') break;
        lVar4 = (longdouble)
                CDamageModifier::GetModifier
                          (*(CDamageModifier **)(*(int *)(param_1 + 0x158) + iVar2 * 0xc));
        iVar3 = *(int *)(param_1 + 0x158);
        iVar2 = *(int *)(iVar3 + 8 + iVar2 * 0xc);
        local_20 = (float)lVar4 * local_20;
        if (iVar2 == -1) goto LAB_005ffc3a;
      }
      iVar3 = *(int *)(param_1 + 0x158);
      iVar2 = *(int *)(iVar3 + 8 + iVar2 * 0xc);
    } while (iVar2 != -1);
  }
LAB_005ffc3a:
  return (longdouble)local_20;
}

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)