L L4D2node

CBaseEntity::PhysicsStepRunTimestep

0x0078fa30 · 982 bytes · __thiscall

_ZN11CBaseEntity22PhysicsStepRunTimestepEf

Decompiled

undefined (2 params)

/* CBaseEntity::PhysicsStepRunTimestep(float) */

void __thiscall CBaseEntity::PhysicsStepRunTimestep(CBaseEntity *this,float param_1)

{
  undefined4 uVar1;
  CBaseEntity CVar2;
  bool bVar3;
  char cVar4;
  uint uVar5;
  longdouble lVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float local_28;
  float local_24;
  float local_20;
  
  PhysicsCheckVelocity(this);
  CVar2 = this[0x150];
  cVar4 = PhysicsCheckWater(this);
  if (((byte)this[0x14d] & 0x10) != 0) {
    CalcAbsoluteVelocity(this);
  }
  uVar1 = *(undefined4 *)(this + 0x27c);
  if (((byte)CVar2 & 1) == 0) {
    uVar5 = *(uint *)(this + 0x150);
    if (((uVar5 & 0x400) == 0) && (((uVar5 & 0x800) == 0 || (this[0x253] == (CBaseEntity)0x0)))) {
      if (((byte)this[0x14d] & 0x10) != 0) {
        CalcAbsoluteVelocity(this);
      }
      if (cVar4 != '\0') goto LAB_0078faa8;
      bVar3 = true;
      PhysicsAddHalfGravity(this,param_1);
      uVar5 = *(uint *)(this + 0x150);
    }
    else {
      bVar3 = false;
    }
  }
  else {
LAB_0078faa8:
    uVar5 = *(uint *)(this + 0x150);
    bVar3 = false;
  }
  if ((uVar5 & 0x200000) == 0) {
    if (((byte)this[0x14d] & 0x10) != 0) {
      CalcAbsoluteVelocity(this);
    }
    if (((((vec3_origin != *(float *)(this + 0x274)) || (DAT_01053d4c != *(float *)(this + 0x278)))
         || (DAT_01053d50 != *(float *)(this + 0x27c))) ||
        ((vec3_origin != *(float *)(this + 0x268) || (DAT_01053d4c != *(float *)(this + 0x26c)))))
       || (DAT_01053d50 != *(float *)(this + 0x270))) {
      if (((byte)this[0x14d] & 0x10) != 0) {
        CalcAbsoluteVelocity(this);
      }
      local_28 = *(float *)(this + 0x274);
      local_24 = *(float *)(this + 0x278);
      local_20 = *(float *)(this + 0x27c);
      SetGroundEntity(this,(CBaseEntity *)0x0);
      if ((((byte)CVar2 & 1) != 0) &&
         (fVar7 = SQRT(local_24 * local_24 + local_28 * local_28 + local_20 * local_20),
         fVar7 != 0.0)) {
        fVar9 = *(float *)(sv_friction._28_4_ + 0x2c);
        lVar6 = (longdouble)(**(code **)(*(int *)this + 0x260))(this);
        fVar8 = *(float *)(sv_stopspeed._28_4_ + 0x2c);
        if (*(float *)(sv_stopspeed._28_4_ + 0x2c) <= fVar7) {
          fVar8 = fVar7;
        }
        fVar9 = fVar7 - fVar9 * param_1 * fVar8 * (float)lVar6;
        if (fVar9 <= 0.0) {
          fVar9 = 0.0;
        }
        local_24 = local_24 * (fVar9 / fVar7);
        local_28 = (fVar9 / fVar7) * local_28;
      }
      local_28 = local_28 + *(float *)(this + 0x268);
      local_24 = local_24 + *(float *)(this + 0x26c);
      local_20 = local_20 + *(float *)(this + 0x270);
      SetAbsVelocity(this,(Vector *)&local_28);
      SimulateAngles(this,param_1);
      PhysicsCheckVelocity(this);
      PhysicsTryMove(this,param_1,(CGameTrace *)0x0);
      PhysicsCheckVelocity(this);
      if (((byte)this[0x14d] & 0x10) != 0) {
        CalcAbsoluteVelocity(this);
      }
      local_24 = *(float *)(this + 0x278) - *(float *)(this + 0x26c);
      local_28 = *(float *)(this + 0x274) - *(float *)(this + 0x268);
      local_20 = *(float *)(this + 0x27c) - *(float *)(this + 0x270);
      SetAbsVelocity(this,(Vector *)&local_28);
      PhysicsCheckVelocity(this);
      if (((byte)this[0x150] & 1) == 0) {
        PhysicsStepRecheckGround(this);
      }
      PhysicsTouchTriggers(this,(Vector *)0x0);
    }
    uVar5 = *(uint *)(this + 0x150);
  }
  if ((uVar5 & 1) == 0) {
    if ((bVar3) && (PhysicsAddHalfGravity(this,param_1), ((byte)this[0x150] & 1) != 0)) {
LAB_0078fc9c:
      (**(code **)(*(int *)this + 0x1cc))(this,uVar1);
      return;
    }
  }
  else if (bVar3) goto LAB_0078fc9c;
  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)