L L4D2node

CBaseEntity::SetAbsVelocity

0x0060bb40 · 571 bytes · __thiscall

_ZN11CBaseEntity14SetAbsVelocityERK6Vector

Decompiled

undefined (2 params)

/* CBaseEntity::SetAbsVelocity(Vector const&) */

void __thiscall CBaseEntity::SetAbsVelocity(CBaseEntity *this,Vector *param_1)

{
  CBaseEntity *this_00;
  uint uVar1;
  undefined *puVar2;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  if (((*(float *)param_1 == *(float *)(this + 0x274)) &&
      (*(float *)(param_1 + 4) == *(float *)(this + 0x278))) &&
     (*(float *)(param_1 + 8) == *(float *)(this + 0x27c))) {
    return;
  }
  InvalidatePhysicsRecursive(this,4);
  uVar1 = *(uint *)(this + 0x188);
  *(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) & 0xffffefff;
  puVar2 = g_pEntityList;
  *(undefined4 *)(this + 0x274) = *(undefined4 *)param_1;
  *(undefined4 *)(this + 0x278) = *(undefined4 *)(param_1 + 4);
  *(undefined4 *)(this + 0x27c) = *(undefined4 *)(param_1 + 8);
  if (((uVar1 == 0xffffffff) ||
      (puVar2 = puVar2 + (uVar1 & 0xfff) * 0x10, puVar2 == (undefined *)0xfffffffc)) ||
     ((*(uint *)(puVar2 + 8) != uVar1 >> 0xc ||
      (this_00 = *(CBaseEntity **)(puVar2 + 4), this_00 == (CBaseEntity *)0x0)))) {
    if (((*(float *)param_1 != *(float *)(this + 0x2ec)) ||
        (*(float *)(param_1 + 4) != *(float *)(this + 0x2f0))) ||
       (*(float *)(param_1 + 8) != *(float *)(this + 0x2f4))) {
      (**(code **)(*(int *)this + 0x30c))(this,this + 0x2ec);
      *(undefined4 *)(this + 0x2ec) = *(undefined4 *)param_1;
      *(undefined4 *)(this + 0x2f0) = *(undefined4 *)(param_1 + 4);
      *(undefined4 *)(this + 0x2f4) = *(undefined4 *)(param_1 + 8);
    }
  }
  else {
    uVar1 = *(uint *)(this_00 + 0x14c);
    if ((uVar1 & 0x1000) != 0) {
      CalcAbsoluteVelocity(this_00);
      uVar1 = *(uint *)(this_00 + 0x14c);
    }
    local_34 = *(float *)param_1 - *(float *)(this_00 + 0x274);
    local_30 = *(float *)(param_1 + 4) - *(float *)(this_00 + 0x278);
    local_2c = *(float *)(param_1 + 8) - *(float *)(this_00 + 0x27c);
    if ((uVar1 & 0x800) != 0) {
      CalcAbsolutePosition(this_00);
    }
    VectorIRotate(&local_34,(matrix3x4_t *)(this_00 + 0x28c),&local_28);
    if (((local_28 != *(float *)(this + 0x2ec)) || (local_24 != *(float *)(this + 0x2f0))) ||
       (local_20 != *(float *)(this + 0x2f4))) {
      (**(code **)(*(int *)this + 0x30c))(this,this + 0x2ec);
      *(float *)(this + 0x2ec) = local_28;
      *(float *)(this + 0x2f0) = local_24;
      *(float *)(this + 0x2f4) = local_20;
    }
  }
  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)