CBaseEntity::PhysicsAddGravityMove
0x00476dc0 · 429 bytes · __thiscall
_ZN11CBaseEntity21PhysicsAddGravityMoveER6Vector
Decompiled
undefined (2 params)
/* CBaseEntity::PhysicsAddGravityMove(Vector&) */
void __thiscall CBaseEntity::PhysicsAddGravityMove(CBaseEntity *this,Vector *param_1)
{
float fVar1;
undefined4 uVar2;
undefined4 uVar3;
int iVar4;
float fVar5;
float local_18;
float local_14;
float local_10;
if (((byte)this[0x14d] & 0x10) != 0) {
CalcAbsoluteVelocity(this);
}
local_18 = *(float *)(this + 0x274);
local_14 = *(float *)(this + 0x278);
local_10 = *(float *)(this + 0x27c);
*(float *)param_1 = (*(float *)(this + 0x268) + local_18) * *(float *)(gpGlobals + 0x10);
iVar4 = gpGlobals;
*(float *)(param_1 + 4) = (*(float *)(this + 0x26c) + local_14) * *(float *)(gpGlobals + 0x10);
if (((byte)this[0x150] & 1) == 0) {
fVar5 = *(float *)(this + 0x2c0);
if (fVar5 == 0.0) {
fVar5 = 1.0;
}
fVar1 = *(float *)(iVar4 + 0x10);
fVar5 = local_10 - *(float *)(sv_gravity._28_4_ + 0x2c) * fVar1 * fVar5;
*(float *)(param_1 + 8) = ((local_10 + fVar5) * 0.5 + *(float *)(this + 0x270)) * fVar1;
uVar2 = *(undefined4 *)(this + 0x268);
uVar3 = *(undefined4 *)(this + 0x26c);
if (*(float *)(this + 0x270) != 0.0) {
(**(code **)(*(int *)this + 0x2fc))(this,this + 0x268);
*(undefined4 *)(this + 0x270) = 0;
*(undefined4 *)(this + 0x268) = uVar2;
*(undefined4 *)(this + 0x26c) = uVar3;
}
local_10 = fVar5;
SetAbsVelocity(this,(Vector *)&local_18);
PhysicsCheckVelocity(this);
return;
}
*(float *)(param_1 + 8) = *(float *)(iVar4 + 0x10) * *(float *)(this + 0x270);
return;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.