L L4D2node

CGameMovement::CheckFalling

0x00454b80 · 642 bytes · __thiscall

_ZN13CGameMovement12CheckFallingEv

Decompiled

undefined (1 param)

/* CGameMovement::CheckFalling() */

void __thiscall CGameMovement::CheckFalling(CGameMovement *this)

{
  char cVar1;
  int iVar2;
  CBaseEntity *pCVar3;
  CBaseEntity *this_00;
  int iVar4;
  uint uVar5;
  float fVar6;
  float fVar7;
  
  iVar2 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4));
  pCVar3 = *(CBaseEntity **)(this + 4);
  if ((iVar2 == 0) || (*(int *)(pCVar3 + 0x100) < 1)) goto LAB_00454bdf;
  if (350.0 <= *(float *)(pCVar3 + 0x1aa4)) {
    pCVar3 = (CBaseEntity *)CBaseEntity::GetGroundEntity(pCVar3);
    cVar1 = CBaseEntity::IsFloating(pCVar3);
    pCVar3 = *(CBaseEntity **)(this + 4);
    if ((cVar1 != '\0') &&
       (fVar7 = *(float *)(pCVar3 + 0x1aa4) - 200.0, *(float *)(pCVar3 + 0x1aa4) != fVar7)) {
      (**(code **)(*(int *)(pCVar3 + 0x1a40) + 4))(pCVar3 + 0x1a40,pCVar3 + 0x1aa4);
      *(float *)(pCVar3 + 0x1aa4) = fVar7;
      pCVar3 = *(CBaseEntity **)(this + 4);
    }
    pCVar3 = (CBaseEntity *)CBaseEntity::GetGroundEntity(pCVar3);
    if (((byte)pCVar3[0x14d] & 0x10) != 0) {
      CBaseEntity::CalcAbsoluteVelocity(pCVar3);
    }
    this_00 = *(CBaseEntity **)(this + 4);
    if (*(float *)(pCVar3 + 0x27c) <= 0.0 && *(float *)(pCVar3 + 0x27c) != 0.0) {
      pCVar3 = (CBaseEntity *)CBaseEntity::GetGroundEntity(this_00);
      if (((byte)pCVar3[0x14d] & 0x10) != 0) {
        CBaseEntity::CalcAbsoluteVelocity(pCVar3);
      }
      iVar4 = *(int *)(this + 4);
      fVar6 = *(float *)(pCVar3 + 0x27c);
      fVar7 = *(float *)(iVar4 + 0x1aa4);
      iVar2 = iVar4 + 0x1aa4;
      if (fVar7 != fVar6 + fVar7) {
        (**(code **)(*(int *)(iVar4 + 0x1a40) + 4))(iVar4 + 0x1a40,iVar2);
        *(float *)(iVar4 + 0x1aa4) = fVar6 + fVar7;
        iVar4 = *(int *)(this + 4);
        fVar7 = *(float *)(iVar4 + 0x1aa4);
        iVar2 = iVar4 + 0x1aa4;
      }
      fVar6 = 0.1;
      if (0.1 <= fVar7) {
        fVar6 = fVar7;
      }
      if (fVar6 != fVar7) {
        (**(code **)(*(int *)(iVar4 + 0x1a40) + 4))(iVar4 + 0x1a40,iVar2);
        *(float *)(iVar4 + 0x1aa4) = fVar6;
        this_00 = *(CBaseEntity **)(this + 4);
        goto LAB_00454c87;
      }
    }
    else {
LAB_00454c87:
      fVar7 = *(float *)(this_00 + 0x1aa4);
    }
    if (SafeFallSpeed < fVar7) {
      cVar1 = (**(code **)(*IMoveHelper::sm_pSingleton + 0x28))(IMoveHelper::sm_pSingleton);
      uVar5 = 0x3f800000;
      if (cVar1 == '\0') goto LAB_00454bcb;
    }
    else {
      uVar5 = -(uint)(SafeFallSpeed * 0.5 < fVar7) & 0x3f59999a;
    }
    (**(code **)(*IMoveHelper::sm_pSingleton + 0x2c))(IMoveHelper::sm_pSingleton,1);
  }
  else {
    uVar5 = -(uint)(0.0 < *(float *)(pCVar3 + 0x1aa4)) & 0x3f000000;
  }
LAB_00454bcb:
  (**(code **)(*(int *)this + 0xdc))(this,uVar5);
  pCVar3 = *(CBaseEntity **)(this + 4);
LAB_00454bdf:
  iVar2 = CBaseEntity::GetGroundEntity(pCVar3);
  if ((iVar2 != 0) && (iVar2 = *(int *)(this + 4), *(float *)(iVar2 + 0x1aa4) != 0.0)) {
    (**(code **)(*(int *)(iVar2 + 0x1a40) + 4))(iVar2 + 0x1a40,iVar2 + 0x1aa4);
    *(undefined4 *)(iVar2 + 0x1aa4) = 0;
  }
  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)