L L4D2node

CBreakableProp::UpdateHealth

0x007ee610 · 347 bytes · __thiscall

_ZN14CBreakableProp12UpdateHealthEiP11CBaseEntity

Decompiled

undefined (3 params)

/* CBreakableProp::UpdateHealth(int, CBaseEntity*) */

undefined4 __thiscall
CBreakableProp::UpdateHealth(CBreakableProp *this,int param_1,CBaseEntity *param_2)

{
  undefined4 *puVar1;
  float local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_48;
  
  if (*(int *)(this + 0x100) != param_1) {
    (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
    *(int *)(this + 0x100) = param_1;
    if (*(int *)(this + 0xfc) == 0) {
      (**(code **)(*(int *)this + 0x20c))(this,this + 0xfc);
      local_80 = 1.0;
      *(undefined4 *)(this + 0xfc) = 1;
      param_1 = *(int *)(this + 0x100);
    }
    else {
      local_80 = (float)*(int *)(this + 0xfc);
    }
    local_80 = (float)param_1 / local_80;
    if (local_80 <= 0.0) {
      local_80 = 0.0;
    }
    if (1.0 <= local_80) {
      local_80 = 1.0;
    }
    variant_t::Set((variant_t *)(this + 0x1414),1,&local_80);
    local_7c = *(undefined4 *)(this + 0x1414);
    local_78 = *(undefined4 *)(this + 0x1418);
    local_74 = *(undefined4 *)(this + 0x141c);
    local_70 = *(undefined4 *)(this + 0x1420);
    local_6c = *(undefined4 *)(this + 0x1424);
    CBaseEntityOutput::FireOutput
              ((CBaseEntityOutput *)(this + 0x1414),(CTakeDamageInfo *)&local_7c,param_2,this,0);
    if (*(int *)(this + 0x100) < 1) {
      CTakeDamageInfo::CTakeDamageInfo((CTakeDamageInfo *)&local_7c);
      puVar1 = (undefined4 *)(**(code **)(*(int *)this + 0xc))(this);
      local_48 = *puVar1;
      Break(this,param_2,(CTakeDamageInfo *)&local_7c);
      return 0;
    }
  }
  return 1;
}

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)