L L4D2node

Script_GetPhysVelocity

0x00b43d00 · 193 bytes · __cdecl

_ZL22Script_GetPhysVelocityP9HSCRIPT__

Decompiled

undefined (1 param)

/* Script_GetPhysVelocity(HSCRIPT__*) */

CBaseEntity * Script_GetPhysVelocity(HSCRIPT__ *param_1)

{
  code *pcVar1;
  ScriptClassDesc_t *pSVar2;
  CBaseEntity *this;
  int iVar3;
  
  if (param_1 == (HSCRIPT__ *)0x0) {
    this = (CBaseEntity *)0x0;
  }
  else {
    pcVar1 = *(code **)(*g_pScriptVM + 0x68);
    pSVar2 = GetScriptDesc<CBaseEntity>((CBaseEntity *)0x0);
    this = (CBaseEntity *)(*pcVar1)(g_pScriptVM,param_1,pSVar2);
  }
  if (this[0x186] != (CBaseEntity)0x6) {
    if (((byte)this[0x14d] & 0x10) != 0) {
      CBaseEntity::CalcAbsoluteVelocity(this);
    }
    return this + 0x274;
  }
  if (Script_GetPhysVelocity(HSCRIPT__*)::vVel == '\0') {
    iVar3 = __cxa_guard_acquire(&Script_GetPhysVelocity(HSCRIPT__*)::vVel);
    if (iVar3 != 0) {
      __cxa_guard_release(&Script_GetPhysVelocity(HSCRIPT__*)::vVel);
    }
  }
  (**(code **)(**(int **)(this + 0x238) + 0xd4))
            (*(int **)(this + 0x238),Script_GetPhysVelocity(HSCRIPT__*)::vVel,0);
  return (CBaseEntity *)Script_GetPhysVelocity(HSCRIPT__*)::vVel;
}

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)