L L4D2node

CChargerClaw::GetPlayerDamage

0x00534760 · 107 bytes · __cdecl

_ZNK12CChargerClaw15GetPlayerDamageEP13CTerrorPlayer

Decompiled

undefined (1 param)

/* CChargerClaw::GetPlayerDamage(CTerrorPlayer*) const */

longdouble CChargerClaw::GetPlayerDamage(CTerrorPlayer *param_1)

{
  char cVar1;
  int iVar2;
  float fVar3;
  
  cVar1 = CTerrorGameRules::HasPlayerControlledZombies();
  if (cVar1 == '\0') {
    iVar2 = GetDifficulty();
    if (iVar2 == 1) {
      fVar3 = 10.0;
    }
    else {
      if (iVar2 < 2) {
        fVar3 = 5.0;
        if (iVar2 == 0) goto LAB_00534779;
      }
      else {
        fVar3 = 15.0;
        if ((iVar2 == 2) || (fVar3 = 20.0, iVar2 == 3)) goto LAB_00534779;
      }
      fVar3 = 100.0;
    }
  }
  else {
    fVar3 = *(float *)(charger_pz_claw_dmg._28_4_ + 0x2c);
  }
LAB_00534779:
  return (longdouble)fVar3;
}

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)