L L4D2node

CPhysicsCannister::OnTakeDamage

0x00788c30 · 463 bytes · __thiscall

_ZN17CPhysicsCannister12OnTakeDamageERK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* CPhysicsCannister::OnTakeDamage(CTakeDamageInfo const&) */

undefined4 __thiscall
CPhysicsCannister::OnTakeDamage(CPhysicsCannister *this,CTakeDamageInfo *param_1)

{
  uint uVar1;
  undefined4 uVar2;
  Vector *pVVar3;
  CBaseEntity *pCVar4;
  int iVar5;
  undefined *puVar6;
  int iVar7;
  
  uVar2 = 0;
  if (this[0x105] != (CPhysicsCannister)0x0) {
    if (this[0x1a74] == (CPhysicsCannister)0x0) {
      iVar5 = *(int *)(this + 0x100);
      iVar7 = iVar5 - (int)*(float *)(param_1 + 0x3c);
      if (iVar5 != iVar7) {
        (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
        *(int *)(this + 0x100) = iVar7;
        iVar5 = iVar7;
      }
      if (iVar5 < 0) {
        uVar1 = *(uint *)(param_1 + 0x34);
        if (((uVar1 == 0xffffffff) ||
            (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
           (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) {
          pCVar4 = (CBaseEntity *)0x0;
        }
        else {
          pCVar4 = *(CBaseEntity **)(puVar6 + 4);
        }
        Explode(this,pCVar4);
        uVar2 = 1;
      }
      else if (((*(uint *)(param_1 + 0x48) & 0x40) == 0) &&
              (((*(uint *)(param_1 + 0x48) & 0x85) == 0 ||
               (iVar5 = (**(code **)(*random_valve + 8))(random_valve,1,100), 0x31 < iVar5)))) {
        uVar2 = 1;
      }
      else {
        uVar1 = *(uint *)(param_1 + 0x34);
        if (((uVar1 == 0xffffffff) ||
            (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
           (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) {
          pVVar3 = (Vector *)0x0;
        }
        else {
          pVVar3 = *(Vector **)(puVar6 + 4);
        }
        CannisterActivate((CBaseEntity *)this,pVVar3);
        uVar2 = 1;
      }
    }
    else if ((0.1 < *(float *)(gpGlobals + 0xc) - *(float *)(this + 0x1a84)) &&
            (uVar2 = 0, (*(uint *)(param_1 + 0x48) & 0x2000004a) != 0)) {
      uVar1 = *(uint *)(param_1 + 0x34);
      pCVar4 = (CBaseEntity *)0x0;
      if ((uVar1 != 0xffffffff) &&
         ((puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc &&
          (*(uint *)(puVar6 + 8) == uVar1 >> 0xc)))) {
        pCVar4 = *(CBaseEntity **)(puVar6 + 4);
      }
      Explode(this,pCVar4);
      return 0;
    }
  }
  return uVar2;
}

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)