CBaseEntity::VPhysicsUpdate
0x00410760 · 643 bytes · __thiscall
_ZN11CBaseEntity14VPhysicsUpdateEP14IPhysicsObject
Decompiled
undefined (2 params)
/* CBaseEntity::VPhysicsUpdate(IPhysicsObject*) */
void __thiscall CBaseEntity::VPhysicsUpdate(CBaseEntity *this,IPhysicsObject *param_1)
{
uint uVar1;
char cVar2;
undefined1 *puVar3;
undefined4 uVar4;
undefined *puVar5;
longdouble lVar6;
uint local_40;
uint local_3c;
uint local_38;
float local_34;
float local_30;
float local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
if (this[0x186] == (CBaseEntity)0x6) {
uVar1 = *(uint *)(this + 0x188);
if ((((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar5 + 4) != 0)) {
puVar3 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
puVar3 = *(undefined1 **)(this + 0x7c);
}
DevWarning("Updating physics on object in hierarchy %s!\n",puVar3);
return;
}
(**(code **)(*(int *)param_1 + 0xc4))(param_1,(Vector *)&local_40,(QAngle *)&local_34);
if ((((uint)local_34 & 0x7f800000) == 0x7f800000) ||
(((uint)local_30 & 0x7f800000) == 0x7f800000)) {
uVar4 = GetDebugName(this);
Msg("Infinite angles from vphysics! (entity %s)\n",uVar4);
local_34 = vec3_angle;
local_30 = DAT_01053d40;
local_2c = DAT_01053d44;
}
if (((byte)this[0x14d] & 8) != 0) {
CalcAbsolutePosition(this);
}
local_28 = *(undefined4 *)(this + 0x2e0);
local_24 = *(undefined4 *)(this + 0x2e4);
local_20 = *(undefined4 *)(this + 0x2e8);
lVar6 = (longdouble)AngleNormalize(local_34);
local_34 = (float)lVar6;
lVar6 = (longdouble)AngleNormalize(local_30);
local_30 = (float)lVar6;
lVar6 = (longdouble)AngleNormalize(local_2c);
local_2c = (float)lVar6;
NetworkQuantize(this,(Vector *)&local_40,(QAngle *)&local_34);
if ((((local_40 & 0x7f800000) == 0x7f800000) || ((local_3c & 0x7f800000) == 0x7f800000)) ||
((local_38 & 0x7f800000) == 0x7f800000)) {
uVar4 = GetDebugName(this);
Msg("Infinite origin from vphysics! (entity %s)\n",uVar4);
}
else {
SetAbsOrigin(this,(Vector *)&local_40);
}
SetAbsAngles(this,(QAngle *)&local_34);
cVar2 = (**(code **)(*(int *)param_1 + 0xc))(param_1);
if ((cVar2 != '\0') && (*(int *)(this + 0x234) == 3)) {
SetCollisionGroup(this,1);
}
PhysicsTouchTriggers(this,(Vector *)&local_28);
PhysicsRelinkChildren(this,*(float *)(gpGlobals + 0x10));
}
else if (this[0x186] == (CBaseEntity)0x7) {
VPhysicsUpdatePusher(this,param_1);
}
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.