L L4D2node

CMoveHelperServer::PlayerFallingDamage

0x006f67c0 · 490 bytes · __thiscall

_ZN17CMoveHelperServer19PlayerFallingDamageEv

Decompiled

undefined (1 param)

/* CMoveHelperServer::PlayerFallingDamage() */

undefined4 __thiscall CMoveHelperServer::PlayerFallingDamage(CMoveHelperServer *this)

{
  byte *pbVar1;
  int *piVar2;
  code *pcVar3;
  char cVar4;
  undefined4 uVar5;
  CBaseEntity *pCVar6;
  CBaseEntity *pCVar7;
  CBaseEntity *this_00;
  longdouble lVar8;
  CTakeDamageInfo local_7c;
  undefined1 local_7b;
  undefined1 local_7a;
  undefined1 local_79;
  
  uVar5 = (**(code **)(**(int **)(this + 4) + 0x16c))(*(int **)(this + 4));
  if ((char)uVar5 == '\0') {
    return 1;
  }
  this_00 = *(CBaseEntity **)(this + 4);
  if (this_00 != (CBaseEntity *)0x0) {
    cVar4 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
    if (cVar4 != '\0') goto LAB_006f6805;
  }
  this_00 = (CBaseEntity *)0x0;
LAB_006f6805:
  lVar8 = (longdouble)(**(code **)(*g_pGameRules + 0xec))(g_pGameRules,this_00);
  if (0.0 < (float)lVar8) {
    pbVar1 = *(byte **)(gpGlobals + 0x58);
    if (((pbVar1 == (byte *)0x0) || ((*pbVar1 & 2) != 0)) ||
       (piVar2 = *(int **)(pbVar1 + 0xc), piVar2 == (int *)0x0)) {
      pCVar6 = (CBaseEntity *)0x0;
      pCVar7 = (CBaseEntity *)0x0;
    }
    else {
      pCVar6 = (CBaseEntity *)(**(code **)(*piVar2 + 0x18))(piVar2);
      pbVar1 = *(byte **)(gpGlobals + 0x58);
      pCVar7 = (CBaseEntity *)0x0;
      if (pbVar1 != (byte *)0x0) {
        if (((*pbVar1 & 2) == 0) && (piVar2 = *(int **)(pbVar1 + 0xc), piVar2 != (int *)0x0)) {
          pCVar7 = (CBaseEntity *)(**(code **)(*piVar2 + 0x18))(piVar2);
        }
        else {
          pCVar7 = (CBaseEntity *)0x0;
        }
      }
    }
    CTakeDamageInfo::CTakeDamageInfo(&local_7c,pCVar7,pCVar6,(float)lVar8,0x20,0);
    CBaseEntity::TakeDamage(this_00,&local_7c);
    if (*(float *)(this_00 + 0x4008) <= *(float *)(gpGlobals + 0xc)) {
      pcVar3 = *(code **)(*(int *)this + 0x20);
      if (((byte)this_00[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_00);
      }
      (*pcVar3)(this,this_00 + 0x2e0,"Player.FallDamage");
    }
  }
  if (*(int *)(this_00 + 0x100) < 1) {
    uVar5 = (**(code **)(*g_pGameRules + 0x108))(g_pGameRules,this_00);
    if ((char)uVar5 != '\0') {
      uVar5 = 0;
      local_7c = (CTakeDamageInfo)0x0;
      local_7b = 0;
      local_7a = 0;
      local_79 = 0xff;
      UTIL_ScreenFade(this_00,(color32_s *)&local_7c,0.0,9999.0,10);
    }
  }
  return uVar5;
}

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)