L L4D2node

CGameMovement::PerformFlyCollisionResolution

0x0045cec0 · 429 bytes · __thiscall

_ZN13CGameMovement29PerformFlyCollisionResolutionER10CGameTraceR6Vector

Decompiled

undefined (3 params)

/* CGameMovement::PerformFlyCollisionResolution(CGameTrace&, Vector&) */

void __thiscall
CGameMovement::PerformFlyCollisionResolution
          (CGameMovement *this,CGameTrace *param_1,Vector *param_2)

{
  float fVar1;
  byte bVar2;
  int iVar3;
  longdouble lVar4;
  float fVar5;
  
  bVar2 = *(byte *)(*(int *)(this + 4) + 0x187);
  if (bVar2 < 2) {
    fVar5 = 1.0;
    if (bVar2 == 1) {
      fVar5 = 2.0 - *(float *)(*(int *)(this + 4) + 0x2180);
    }
    ClipVelocity(this,(Vector *)(*(int *)(this + 8) + 0x40),(Vector *)(param_1 + 0x18),
                 (Vector *)(*(int *)(this + 8) + 0x40),fVar5);
  }
  fVar5 = *(float *)(param_1 + 0x20);
  lVar4 = (longdouble)(**(code **)(*(int *)this + 0x38))(this);
  if ((float)lVar4 < fVar5) {
    iVar3 = *(int *)(this + 8);
    fVar5 = *(float *)(iVar3 + 0x48);
    if (fVar5 < *(float *)(sv_gravity._28_4_ + 0x2c) * *(float *)(gpGlobals + 0x10)) {
      (**(code **)(*(int *)this + 0x100))(this,param_1);
      *(undefined4 *)(*(int *)(this + 8) + 0x48) = 0;
      iVar3 = *(int *)(this + 8);
      fVar5 = *(float *)(iVar3 + 0x48);
    }
    fVar1 = *(float *)(iVar3 + 0x40);
    if ((900.0 <= *(float *)(iVar3 + 0x44) * *(float *)(iVar3 + 0x44) + fVar1 * fVar1 +
                  fVar5 * fVar5) && (*(char *)(*(int *)(this + 4) + 0x187) == '\x01')) {
      fVar5 = *(float *)(gpGlobals + 0x10) * 0.9 * (1.0 - *(float *)(param_1 + 0x2c));
      *(float *)param_2 = fVar1 * fVar5;
      *(float *)(param_2 + 4) = *(float *)(iVar3 + 0x44) * fVar5;
      *(float *)(param_2 + 8) = fVar5 * *(float *)(iVar3 + 0x48);
      PushEntity(this,param_2,param_1);
      return;
    }
    (**(code **)(*(int *)this + 0x100))(this,param_1);
    iVar3 = *(int *)(this + 8);
    *(undefined4 *)(iVar3 + 0x40) = 0;
    *(undefined4 *)(iVar3 + 0x44) = 0;
    *(undefined4 *)(iVar3 + 0x48) = 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)