L L4D2node

CTerrorGameRules::FlPlayerFallDamage

0x0050c380 · 1409 bytes · __thiscall

_ZN16CTerrorGameRules18FlPlayerFallDamageEP11CBasePlayer

Decompiled

undefined (2 params)

/* CTerrorGameRules::FlPlayerFallDamage(CBasePlayer*) */

longdouble __thiscall
CTerrorGameRules::FlPlayerFallDamage(CTerrorGameRules *this,CBasePlayer *param_1)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  uint uVar4;
  char cVar5;
  int iVar6;
  int *piVar7;
  undefined4 uVar8;
  int *piVar9;
  CBaseEntity *this_00;
  CBasePlayer *this_01;
  undefined *puVar10;
  code *pcVar11;
  longdouble lVar12;
  longdouble lVar13;
  float fVar14;
  float fVar15;
  CAI_Concept local_30 [8];
  float local_28;
  float local_24;
  undefined4 local_20;
  
  if ((param_1 == (CBasePlayer *)0x0) ||
     (cVar5 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar5 == '\0')) {
    lVar12 = (longdouble)CCSGameRules::FlPlayerFallDamage((CCSGameRules *)this,param_1);
    fVar15 = (float)lVar12;
    goto LAB_0050c587;
  }
  iVar6 = CBaseEntity::GetGroundEntity((CBaseEntity *)param_1);
  if (iVar6 != 0) {
    piVar7 = (int *)CBaseEntity::GetGroundEntity((CBaseEntity *)param_1);
    cVar5 = (**(code **)(*piVar7 + 0x16c))(piVar7);
    if ((cVar5 != '\0') && (iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar6 == 3))
    {
      this_00 = (CBaseEntity *)CBaseEntity::GetGroundEntity((CBaseEntity *)param_1);
      iVar6 = CBaseEntity::GetTeamNumber(this_00);
      cVar5 = IsASurvivorTeam(iVar6);
      if (cVar5 != '\0') {
        this_01 = (CBasePlayer *)CBaseEntity::GetGroundEntity((CBaseEntity *)param_1);
        lVar12 = (longdouble)
                 RandomFloat(*(undefined4 *)(ZombieSplatSurvivorPitchMin._28_4_ + 0x2c),
                             *(undefined4 *)(ZombieSplatSurvivorPitchMax._28_4_ + 0x2c));
        lVar13 = (longdouble)
                 RandomFloat(*(undefined4 *)(ZombieSplatSurvivorYawMin._28_4_ + 0x2c),
                             *(undefined4 *)(ZombieSplatSurvivorYawMin._28_4_ + 0x2c));
        local_24 = (float)lVar13;
        local_20 = 0;
        local_28 = (float)lVar12;
        CBasePlayer::SetPunchAngle(this_01,(QAngle *)&local_28);
        uVar8 = *(undefined4 *)(ZombieSplatSurvivorShakeRadius._28_4_ + 0x2c);
        uVar1 = *(undefined4 *)(ZombieSplatSurvivorShakeDuration._28_4_ + 0x2c);
        uVar2 = *(undefined4 *)(ZombieSplatSurvivorShakeFrequency._28_4_ + 0x2c);
        uVar3 = *(undefined4 *)(ZombieSplatSurvivorShakeAmplitude._28_4_ + 0x2c);
        if (((byte)this_01[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this_01);
        }
        UTIL_ScreenShakeObject(this_01,this_01 + 0x2e0,uVar3,uVar2,uVar1,uVar8,0,0);
        pcVar11 = *(code **)(*(int *)this_01 + 0x7b4);
        CAI_Concept::CAI_Concept(local_30,"PlayerShoved");
        (*pcVar11)(this_01,local_30,1,0,0,0,0);
      }
    }
  }
  cVar5 = (**(code **)(*(int *)param_1 + 0x558))(param_1);
  if (cVar5 == '\0') {
    CBaseEntity::EmitSound((CBaseEntity *)param_1,"Player.StopVoice",0.0,(float *)0x0);
  }
  fVar14 = *(float *)(param_1 + 0x1aa4) - SafeFallSpeed;
  if (*(float *)(param_1 + 0x1aa4) == fVar14) {
    if (fVar14 < 0.0) goto LAB_0050c602;
LAB_0050c416:
    fVar14 = fVar14 / (FatalFallSpeed - SafeFallSpeed);
    fVar14 = fVar14 * fVar14 * 100.0;
    iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1);
    if (iVar6 != 3) {
      fVar15 = 0.0;
      if (fVar14 <= 0.0) goto LAB_0050c587;
      CTerrorPlayer::OnFallDamage((CTerrorPlayer *)param_1,fVar14);
      piVar7 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                                (gameeventmanager,"player_falldamage",0,0);
      fVar15 = fVar14;
      if (piVar7 == (int *)0x0) goto LAB_0050c587;
      pcVar11 = *(code **)(*piVar7 + 0x30);
      uVar8 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
      (*pcVar11)(piVar7,"userid",uVar8);
      (**(code **)(*piVar7 + 0x38))(piVar7,"damage",fVar14);
      iVar6 = CTerrorPlayer::GetRecentPusher((CTerrorPlayer *)param_1);
      if (iVar6 == 0) {
LAB_0050c640:
        iVar6 = CTerrorPlayer::GetRecentPullPlayer((CTerrorPlayer *)param_1);
        if (iVar6 != 0) {
          pcVar11 = *(code **)(*piVar7 + 0x30);
          iVar6 = CTerrorPlayer::GetRecentPullPlayer((CTerrorPlayer *)param_1);
          uVar8 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(iVar6 + 0x30));
          (*pcVar11)(piVar7,"causer",uVar8);
          goto LAB_0050c697;
        }
        uVar4 = *(uint *)(param_1 + 0x33c4);
        if ((((uVar4 == 0xffffffff) ||
             (puVar10 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc))
            || (*(uint *)(puVar10 + 8) != uVar4 >> 0xc)) || (*(int *)(puVar10 + 4) == 0)) {
          iVar6 = CTerrorPlayer::GetOtherResponsibleForMovement((CTerrorPlayer *)param_1);
          if (iVar6 == 0) goto LAB_0050c697;
          piVar9 = (int *)CTerrorPlayer::GetOtherResponsibleForMovement((CTerrorPlayer *)param_1);
          cVar5 = (**(code **)(*piVar9 + 0x16c))(piVar9);
          if (cVar5 == '\0') goto LAB_0050c697;
          iVar6 = CTerrorPlayer::GetOtherResponsibleForMovement((CTerrorPlayer *)param_1);
          goto LAB_0050c535;
        }
        pcVar11 = *(code **)(*piVar7 + 0x30);
        uVar8 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(*(int *)(puVar10 + 4) + 0x30));
      }
      else {
        piVar9 = (int *)CTerrorPlayer::GetRecentPusher((CTerrorPlayer *)param_1);
        cVar5 = (**(code **)(*piVar9 + 0x16c))(piVar9);
        if (cVar5 == '\0') goto LAB_0050c640;
        iVar6 = CTerrorPlayer::GetRecentPusher((CTerrorPlayer *)param_1);
LAB_0050c535:
        pcVar11 = *(code **)(*piVar7 + 0x30);
        uVar8 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(iVar6 + 0x30));
      }
      (*pcVar11)(piVar7,"causer",uVar8);
LAB_0050c697:
      (**(code **)(*piVar7 + 0x30))(piVar7,"priority",4);
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar7,0);
      return (longdouble)fVar14;
    }
  }
  else {
    (**(code **)(*(int *)(param_1 + 0x1a40) + 4))(param_1 + 0x1a40,param_1 + 0x1aa4);
    *(float *)(param_1 + 0x1aa4) = fVar14;
    if (0.0 <= fVar14) goto LAB_0050c416;
LAB_0050c602:
    iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1);
    fVar14 = 0.0;
    fVar15 = fVar14;
    if (iVar6 != 3) goto LAB_0050c587;
  }
  CTerrorPlayer::OnFallDamage((CTerrorPlayer *)param_1,fVar14);
  fVar15 = 0.0;
LAB_0050c587:
  return (longdouble)fVar15;
}

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)