L L4D2node

CBaseMoveBehavior::SetObjectPhysicsVelocity

0x006f8230 · 687 bytes · __thiscall

_ZN17CBaseMoveBehavior24SetObjectPhysicsVelocityEf

Decompiled

undefined (2 params)

/* CBaseMoveBehavior::SetObjectPhysicsVelocity(float) */

longdouble __thiscall
CBaseMoveBehavior::SetObjectPhysicsVelocity(CBaseMoveBehavior *this,float param_1)

{
  int iVar1;
  char cVar2;
  int *piVar3;
  float fVar4;
  float local_50;
  float local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  Quaternion local_2c [28];
  
  if ((*(int *)(this + 0x490) == 0) || (*(int *)(this + 0x494) == 0)) goto LAB_006f84a1;
  cVar2 = (**(code **)(*(int *)this + 0x154))(this);
  if (cVar2 == '\0') goto LAB_006f84a1;
  iVar1 = *(int *)(this + 0x47c);
  fVar4 = (param_1 - *(float *)(this + 0x484)) + *(float *)(this + 0x2d0);
  piVar3 = *(int **)(g_pPositionInterpolators + iVar1 * 4);
  *(float *)(this + 0x4a0) = fVar4;
  fVar4 = fVar4 / (*(float *)(this + 0x488) - *(float *)(this + 0x484));
  if (piVar3 == (int *)0x0) {
    piVar3 = (int *)Motion_GetPositionInterpolator(iVar1);
    *(int **)(g_pPositionInterpolators + iVar1 * 4) = piVar3;
    if (piVar3 != (int *)0x0) goto LAB_006f82b6;
    local_50 = 0.0;
    local_4c = 0.0;
    local_48 = 0.0;
  }
  else {
LAB_006f82b6:
    (**(code **)(*piVar3 + 8))(piVar3,0xffffffff,*(int *)(this + 0x498) + 0x440);
    Motion_SetKeyAngles(-1,(Quaternion *)(*(int *)(this + 0x498) + 0x458));
    (**(code **)(*piVar3 + 8))(piVar3,0,*(int *)(this + 0x490) + 0x440);
    Motion_SetKeyAngles(0,(Quaternion *)(*(int *)(this + 0x490) + 0x458));
    (**(code **)(*piVar3 + 8))(piVar3,1,*(int *)(this + 0x494) + 0x440);
    Motion_SetKeyAngles(1,(Quaternion *)(*(int *)(this + 0x494) + 0x458));
    (**(code **)(*piVar3 + 8))(piVar3,2,*(int *)(this + 0x49c) + 0x440);
    Motion_SetKeyAngles(2,(Quaternion *)(*(int *)(this + 0x49c) + 0x458));
    (**(code **)(*piVar3 + 0xc))(piVar3,fVar4,&local_50);
  }
  Motion_InterpolateRotation(fVar4,*(int *)(this + 0x480),local_2c);
  QuaternionAngles(local_2c,(QAngle *)&local_44);
  fVar4 = 1.0 / param_1;
  local_38 = (local_50 - *(float *)(this + 0x39c)) * fVar4;
  local_34 = (local_4c - *(float *)(this + 0x3a0)) * fVar4;
  local_30 = (local_48 - *(float *)(this + 0x3a4)) * fVar4;
  CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&local_38);
  local_38 = (local_44 - *(float *)(this + 0x3a8)) * fVar4;
  local_34 = (local_40 - *(float *)(this + 0x3ac)) * fVar4;
  local_30 = (local_3c - *(float *)(this + 0x3b0)) * fVar4;
  CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&local_38);
LAB_006f84a1:
  return (longdouble)param_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)