L L4D2node

CTerrorPlayer::GetHealthBuffer

0x00995080 · 306 bytes · __thiscall

_ZNK13CTerrorPlayer15GetHealthBufferEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::GetHealthBuffer() const */

longdouble __thiscall CTerrorPlayer::GetHealthBuffer(CTerrorPlayer *this)

{
  code *pcVar1;
  int *piVar2;
  undefined4 uVar3;
  float fVar4;
  
  fVar4 = *(float *)(this + 0x32f0);
  if ((0.0 < fVar4) &&
     (fVar4 = fVar4 - (*(float *)(gpGlobals + 0xc) - *(float *)(this + 0x32f4)) *
                      *(float *)(PainPillsDecayRate._28_4_ + 0x2c), fVar4 <= 0.0)) {
    fVar4 = 0.0;
  }
  if (fVar4 < (float)*(int *)(this + 0x32f8)) {
    *(int *)(this + 0x32f8) = *(int *)(this + 0x32f8) + -5;
    piVar2 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"player_hurt",0,0);
    if (piVar2 != (int *)0x0) {
      pcVar1 = *(code **)(*piVar2 + 0x30);
      uVar3 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
      (*pcVar1)(piVar2,"userid",uVar3);
      uVar3 = 0;
      if (-1 < *(int *)(this + 0x100)) {
        uVar3 = *(undefined4 *)(this + 0x100);
      }
      (**(code **)(*piVar2 + 0x30))(piVar2,"health",uVar3);
      (**(code **)(*piVar2 + 0x30))(piVar2,"attacker",0);
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar2,0);
      return (longdouble)fVar4;
    }
  }
  return (longdouble)fVar4;
}

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)