L L4D2node

CTerrorPlayer::TakeHealth

0x009dda90 · 312 bytes · __thiscall

_ZN13CTerrorPlayer10TakeHealthEfi

Decompiled

undefined (3 params)

/* CTerrorPlayer::TakeHealth(float, int) */

void __thiscall CTerrorPlayer::TakeHealth(CTerrorPlayer *this,float param_1,int param_2)

{
  CBaseEdict *pCVar1;
  char cVar2;
  int iVar3;
  
  if (this[0x32fc] != (CTerrorPlayer)0x0) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    this[0x32fc] = (CTerrorPlayer)0x0;
  }
  iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  cVar2 = IsASurvivorTeam(iVar3);
  if (cVar2 != '\0') {
    cVar2 = IsOnThirdStrike(this);
    if (cVar2 != '\0') {
      StopTrackedSound(this,"Player.Heartbeat");
    }
  }
  if (*(int *)(this + 0x2e54) != 0) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x2e54) = 0;
  }
  if (this[0x2e58] != (CTerrorPlayer)0x0) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
      this[0x2e58] = (CTerrorPlayer)0x0;
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      this[0x2e58] = (CTerrorPlayer)0x0;
    }
  }
  CBasePlayer::TakeHealth((CBasePlayer *)this,param_1,param_2);
  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)