L L4D2node

CBaseEntity::VPhysicsTakeDamage

0x005ffd10 · 653 bytes · __thiscall

_ZN11CBaseEntity18VPhysicsTakeDamageERK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* CBaseEntity::VPhysicsTakeDamage(CTakeDamageInfo const&) */

undefined4 __thiscall CBaseEntity::VPhysicsTakeDamage(CBaseEntity *this,CTakeDamageInfo *param_1)

{
  int *piVar1;
  char cVar2;
  ushort uVar3;
  int *piVar4;
  int iVar5;
  uint uVar6;
  int iVar7;
  longdouble lVar8;
  longdouble lVar9;
  float fVar10;
  float local_1034;
  float local_1030;
  float local_102c;
  undefined4 local_1028;
  undefined4 local_1024;
  undefined4 local_1020;
  undefined4 local_101c [1027];
  
  piVar1 = *(int **)(this + 0x238);
  uVar6 = *(uint *)(param_1 + 0x48);
  if (((uVar6 & 0x200000) != 0) && (piVar1 != (int *)0x0)) {
    lVar8 = (longdouble)(**(code **)(*piVar1 + 0x78))(piVar1);
    if (500.0 <= (float)lVar8) {
      return 1;
    }
    uVar6 = *(uint *)(param_1 + 0x48);
  }
  if ((uVar6 & 0x82) == 0) {
    cVar2 = (**(code **)(*g_pGameRules + 0x50))(g_pGameRules,uVar6);
    if (cVar2 != '\0') {
      return 1;
    }
    if (*(int *)(param_1 + 0x48) == 0) {
      return 1;
    }
  }
  else if ((((-0.01 < *(float *)param_1) && (*(float *)param_1 < 0.01)) &&
           (-0.01 < *(float *)(param_1 + 4))) &&
          (((*(float *)(param_1 + 4) < 0.01 && (-0.01 < *(float *)(param_1 + 8))) &&
           (*(float *)(param_1 + 8) < 0.01)))) {
    return 1;
  }
  if (piVar1 == (int *)0x0) {
    return 1;
  }
  local_1034 = *(float *)param_1;
  local_1030 = *(float *)(param_1 + 4);
  local_102c = *(float *)(param_1 + 8);
  local_1028 = *(undefined4 *)(param_1 + 0xc);
  local_1024 = *(undefined4 *)(param_1 + 0x10);
  local_1020 = *(undefined4 *)(param_1 + 0x14);
  uVar3 = (**(code **)(*piVar1 + 0x50))(piVar1);
  if ((uVar3 & 4) == 0) {
    if ((uVar3 & 10) == 10) {
      iVar7 = 0;
      iVar5 = (**(code **)(*(int *)this + 0x2b8))(this,local_101c,0x400);
      if (0 < iVar5) {
        do {
          piVar4 = (int *)local_101c[iVar7];
          uVar6 = (**(code **)(*piVar4 + 0x50))(piVar4);
          if ((uVar6 & 2) == 0) {
            (**(code **)(*(int *)local_101c[iVar7] + 0xf8))
                      ((int *)local_101c[iVar7],&local_1034,&local_1028);
            return 1;
          }
          iVar7 = iVar7 + 1;
        } while (iVar7 != iVar5);
      }
    }
  }
  else {
    piVar4 = (int *)CBasePlayer::PlayerHoldingEntity(this);
    if (piVar4 != (int *)0x0) {
      lVar8 = (longdouble)(**(code **)(*piVar4 + 0x6f4))(piVar4,piVar1);
      if ((float)lVar8 != 0.0) {
        lVar9 = (longdouble)(**(code **)(*piVar1 + 0x78))(piVar1);
        fVar10 = (float)lVar9 / (float)lVar8;
        local_1034 = local_1034 * fVar10;
        local_1030 = local_1030 * fVar10;
        local_102c = fVar10 * local_102c;
      }
    }
  }
  (**(code **)(*piVar1 + 0xf8))(piVar1,&local_1034,&local_1028);
  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)