L L4D2node

CTerrorPlayer::OnFallDamage

0x009a6cc0 · 1247 bytes · __thiscall

_ZN13CTerrorPlayer12OnFallDamageEf

Decompiled

undefined (2 params)

/* CTerrorPlayer::OnFallDamage(float) */

void __thiscall CTerrorPlayer::OnFallDamage(CTerrorPlayer *this,float param_1)

{
  CBaseEdict *pCVar1;
  char cVar2;
  int iVar3;
  CEventLog *this_00;
  undefined4 uVar4;
  int *piVar5;
  Vector *pVVar6;
  float *pfVar7;
  byte bVar8;
  longdouble lVar9;
  float fVar10;
  float fVar11;
  float local_dc;
  float local_d8;
  float local_d4;
  float local_d0;
  float local_cc;
  float local_c8;
  float local_c4;
  float local_c0;
  float local_bc;
  float local_b8;
  float local_b4;
  float local_b0;
  float local_ac;
  undefined1 local_a8;
  undefined1 local_a7;
  undefined4 local_a0;
  undefined4 local_84;
  CTakeDamageInfo local_7c [108];
  
  bVar8 = 0;
  iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  if (iVar3 != 3) {
    return;
  }
  iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  if ((((iVar3 == 3) && (iVar3 = (**(code **)(*(int *)this + 0x544))(this), iVar3 == 2)) &&
      (0.0 < *(float *)(ZombieExplodingSplat._28_4_ + 0x2c))) &&
     (((*(float *)(ZombieExplodingSplat._28_4_ + 0x2c) < param_1 &&
       (cVar2 = (**(code **)(*(int *)this + 0x558))(this), cVar2 == '\0')) &&
      (cVar2 = CTerrorGameRules::HasPlayerControlledZombies(), cVar2 == '\0')))) {
    pfVar7 = &local_d0;
    for (iVar3 = 0x15; iVar3 != 0; iVar3 = iVar3 + -1) {
      *pfVar7 = 0.0;
      pfVar7 = pfVar7 + (uint)bVar8 * -2 + 1;
    }
    CTakeDamageInfo::CTakeDamageInfo(local_7c,(CBaseEntity *)this,(CBaseEntity *)this,100.0,0x20,0);
    if (((byte)this[0x14d] & 0x10) != 0) {
      CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
    }
    local_dc = *(float *)(this + 0x274);
    local_d8 = *(float *)(this + 0x278);
    local_d4 = *(float *)(this + 0x27c);
    if (((-0.01 < local_dc) && (local_dc < 0.01)) &&
       ((-0.01 < local_d8 && (((local_d8 < 0.01 && (-0.01 < local_d4)) && (local_d4 < 0.01)))))) {
      local_d4 = -1.0;
    }
    VectorNormalize((Vector *)&local_dc);
    pVVar6 = (Vector *)(**(code **)(*(int *)this + 0x288))(this);
    CalculateMeleeDamageForce(local_7c,(Vector *)&local_dc,pVVar6,0.2);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    local_d0 = *(float *)(this + 0x2e0);
    local_a8 = 5;
    local_cc = *(float *)(this + 0x2e4);
    local_b4 = -local_d8;
    local_b8 = -local_dc;
    local_c8 = *(float *)(this + 0x2e8);
    local_b0 = -local_d4;
    local_ac = local_b4 * local_cc + local_b8 * local_d0 + local_b0 * local_c8;
    local_c4 = local_d0;
    local_c0 = local_cc;
    local_bc = local_c8;
    local_a7 = SignbitsForPlane((cplane_t *)&local_b8);
    local_a0 = 1;
    local_84 = GetWorldEntity();
    ClearMultiDamage();
    CBaseEntity::DispatchTraceAttack
              ((CTakeDamageInfo *)this,(Vector *)local_7c,(CGameTrace *)&local_dc);
    ApplyMultiDamage();
    return;
  }
  cVar2 = (**(code **)(*(int *)this + 0x558))(this);
  if (cVar2 == '\0') {
    iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
    if ((iVar3 == 3) && (iVar3 = (**(code **)(*(int *)this + 0x544))(this), iVar3 == 8)) {
      CBaseEntity::EmitSound((CBaseEntity *)this,"HulkZombie.Thud",0.0,(float *)0x0);
    }
    else {
      CBaseEntity::EmitSound((CBaseEntity *)this,"PlayerZombie.Thud",0.0,(float *)0x0);
    }
  }
  lVar9 = (longdouble)CountdownTimer::Now();
  if ((float)lVar9 + 1.0 != *(float *)(this + 0x30a0)) {
    (**(code **)(*(int *)(this + 0x3098) + 4))(this + 0x3098,this + 0x30a0);
    *(float *)(this + 0x30a0) = (float)lVar9 + 1.0;
  }
  if (*(float *)(this + 0x309c) != 1.0) {
    (**(code **)(*(int *)(this + 0x3098) + 4))(this + 0x3098,this + 0x309c);
    *(undefined4 *)(this + 0x309c) = 0x3f800000;
  }
  this_00 = (CEventLog *)TheLog();
  uVar4 = CEventLog::FormatPlayer(this_00,(CBaseEntity *)this);
  UTIL_LogPrintf("%s landed\n",uVar4);
  fVar10 = *(float *)(ZombiePlayerZombieLandDelay._28_4_ + 0x2c) * 1000.0;
  if (fVar10 != *(float *)(this + 0x2848)) {
    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);
    }
    *(float *)(this + 0x2848) = fVar10;
  }
  piVar5 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
  iVar3 = ZombiePlayerZombieLandDelay._28_4_;
  if (piVar5 != (int *)0x0) {
    fVar10 = *(float *)(ZombiePlayerZombieLandDelay._28_4_ + 0x2c);
    fVar11 = *(float *)(gpGlobals + 0xc) + fVar10;
    if (fVar11 != (float)piVar5[0x4ff]) {
      if ((char)piVar5[0x1b] == '\0') {
        pCVar1 = (CBaseEdict *)piVar5[0xc];
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar3 + 2) = 0;
          iVar3 = ZombiePlayerZombieLandDelay._28_4_;
        }
      }
      else {
        *(byte *)(piVar5 + 0x1c) = *(byte *)(piVar5 + 0x1c) | 1;
      }
      piVar5[0x4ff] = (int)fVar11;
      fVar10 = *(float *)(iVar3 + 0x2c);
    }
    (**(code **)(*piVar5 + 0x69c))(piVar5,fVar10);
  }
  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)