L L4D2node

CKeepUpright::Simulate

0x007a5380 · 391 bytes · __thiscall

_ZN12CKeepUpright8SimulateEP24IPhysicsMotionControllerP14IPhysicsObjectfR6VectorS5_

Decompiled

undefined (6 params)

/* CKeepUpright::Simulate(IPhysicsMotionController*, IPhysicsObject*, float, Vector&, Vector&) */

undefined4 __thiscall
CKeepUpright::Simulate
          (CKeepUpright *this,IPhysicsMotionController *param_1,IPhysicsObject *param_2,
          float param_3,Vector *param_4,Vector *param_5)

{
  float fVar1;
  float local_70;
  float local_6c;
  float local_68;
  Vector local_64 [12];
  float local_58;
  float local_54;
  float local_50;
  matrix3x4_t local_4c [60];
  
  if (this[0x46c] == (CKeepUpright)0x0) {
    return 0;
  }
  *(undefined4 *)param_4 = 0;
  *(undefined4 *)(param_4 + 4) = 0;
  *(undefined4 *)(param_4 + 8) = 0;
  (**(code **)(*(int *)param_2 + 0xd4))(param_2,0,&local_70);
  (**(code **)(*(int *)param_2 + 200))(param_2,local_4c);
  VectorIRotate((float *)(this + 0x444),local_4c,(float *)local_64);
  fVar1 = 1.0 / param_3;
  if (this[0x46d] == (CKeepUpright)0x0) {
    ComputeRotSpeedToAlignAxes
              ((Vector *)&local_58,(Vector *)(this + 0x450),local_64,(float)&local_70,1.0,fVar1);
  }
  else {
    ComputeRotSpeedToAlignAxes
              ((Vector *)&local_58,(Vector *)(this + 0x450),local_64,(float)&local_70,0.0,fVar1);
    local_58 = local_58 - local_70;
    local_54 = local_54 - local_6c;
    local_50 = local_50 - local_68;
  }
  *(float *)param_5 = local_58 * fVar1;
  *(float *)(param_5 + 4) = local_54 * fVar1;
  *(float *)(param_5 + 8) = local_50 * fVar1;
  return 1;
}

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)