L L4D2node

CBaseEntity::UpdateBaseVelocity

0x004771d0 · 310 bytes · __thiscall

_ZN11CBaseEntity18UpdateBaseVelocityEv

Decompiled

undefined (1 param)

/* CBaseEntity::UpdateBaseVelocity() */

void __thiscall CBaseEntity::UpdateBaseVelocity(CBaseEntity *this)

{
  uint uVar1;
  int *piVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  undefined *puVar6;
  float local_18;
  float local_14;
  float local_10;
  
  if (((byte)this[0x150] & 1) != 0) {
    uVar1 = *(uint *)(this + 600);
    if ((((uVar1 != 0xffffffff) &&
         (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) &&
       ((piVar2 = *(int **)(puVar6 + 4), piVar2 != (int *)0x0 &&
        ((*(byte *)((int)piVar2 + 0x151) & 0x10) != 0)))) {
      (**(code **)(*piVar2 + 0x27c))(piVar2,&local_18);
      if (((byte)this[0x152] & 0x80) != 0) {
        local_18 = local_18 + *(float *)(this + 0x268);
        local_14 = local_14 + *(float *)(this + 0x26c);
        local_10 = local_10 + *(float *)(this + 0x270);
      }
      AddFlag(this,0x800000);
      fVar5 = local_10;
      fVar4 = local_14;
      fVar3 = local_18;
      if (((local_18 != *(float *)(this + 0x268)) || (local_14 != *(float *)(this + 0x26c))) ||
         (local_10 != *(float *)(this + 0x270))) {
        (**(code **)(*(int *)this + 0x2fc))(this,this + 0x268);
        *(float *)(this + 0x268) = fVar3;
        *(float *)(this + 0x26c) = fVar4;
        *(float *)(this + 0x270) = fVar5;
      }
    }
  }
  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)