L L4D2node

CBaseCombatCharacter::OnTakeDamage_Alive

0x005f0270 · 479 bytes · __thiscall

_ZN20CBaseCombatCharacter18OnTakeDamage_AliveERK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* CBaseCombatCharacter::OnTakeDamage_Alive(CTakeDamageInfo const&) */

undefined4 __thiscall
CBaseCombatCharacter::OnTakeDamage_Alive(CBaseCombatCharacter *this,CTakeDamageInfo *param_1)

{
  uint uVar1;
  float *pfVar2;
  float *pfVar3;
  undefined *puVar4;
  int *piVar5;
  int iVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float local_28;
  float local_24;
  float local_20;
  
  local_28 = vec3_origin;
  local_24 = DAT_01053d4c;
  local_20 = DAT_01053d50;
  uVar1 = *(uint *)(param_1 + 0x30);
  if ((((uVar1 != 0xffffffff) &&
       (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)) {
    pfVar2 = (float *)(**(code **)(*(int *)this + 0x288))(this);
    piVar5 = (int *)0x0;
    uVar1 = *(uint *)(param_1 + 0x30);
    if (((uVar1 != 0xffffffff) &&
        (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
      piVar5 = *(int **)(puVar4 + 4);
    }
    pfVar3 = (float *)(**(code **)(*piVar5 + 0x288))(piVar5);
    local_28 = *pfVar3 - *pfVar2;
    local_24 = pfVar3[1] - pfVar2[1];
    local_20 = pfVar3[2] - pfVar2[2];
    VectorNormalize((Vector *)&local_28);
  }
  g_vecAttackDir = local_28;
  DAT_00fe36b8 = local_24;
  DAT_00fe36bc = local_20;
  if (this[0x105] != (CBaseCombatCharacter)0x1) {
    fVar8 = *(float *)(param_1 + 0x3c);
    fVar9 = fVar8;
    if (ABS(fVar8) < 8388608.0) {
      fVar9 = (float)(int)fVar8 - (float)(-(uint)(fVar8 < (float)(int)fVar8) & 0x3f800000);
    }
    fVar7 = fVar8 - (fVar8 - fVar9);
    fVar8 = (fVar8 - fVar9) + *(float *)(this + 0x183c);
    if (1.0 <= fVar8) {
      fVar7 = fVar7 + 1.0;
      fVar8 = fVar8 - 1.0;
    }
    *(float *)(this + 0x183c) = fVar8;
    if (fVar7 <= 0.0) {
      return 0;
    }
    iVar6 = *(int *)(this + 0x100) - (int)fVar7;
    if (*(int *)(this + 0x100) != iVar6) {
      (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
      *(int *)(this + 0x100) = iVar6;
    }
  }
  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)