L L4D2node

CGib::AdjustVelocityBasedOnHealth

0x006d53c0 · 118 bytes · __thiscall

_ZN4CGib27AdjustVelocityBasedOnHealthEiR6Vector

Decompiled

undefined (3 params)

/* CGib::AdjustVelocityBasedOnHealth(int, Vector&) */

void __thiscall CGib::AdjustVelocityBasedOnHealth(CGib *this,int param_1,Vector *param_2)

{
  float fVar1;
  
  fVar1 = 0.7;
  if ((param_1 < -0x31) && (fVar1 = 4.0, -200 < param_1)) {
    *(float *)param_2 = *(float *)param_2 + *(float *)param_2;
    *(float *)(param_2 + 4) = *(float *)(param_2 + 4) + *(float *)(param_2 + 4);
    *(float *)(param_2 + 8) = *(float *)(param_2 + 8) + *(float *)(param_2 + 8);
    return;
  }
  *(float *)param_2 = *(float *)param_2 * fVar1;
  *(float *)(param_2 + 4) = *(float *)(param_2 + 4) * fVar1;
  *(float *)(param_2 + 8) = fVar1 * *(float *)(param_2 + 8);
  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)