CBaseEntity::PhysicsToss
0x00478bb0 · 873 bytes · __thiscall
_ZN11CBaseEntity11PhysicsTossEv
Decompiled
undefined (1 param)
/* CBaseEntity::PhysicsToss() */
void __thiscall CBaseEntity::PhysicsToss(CBaseEntity *this)
{
undefined4 uVar1;
undefined4 uVar2;
undefined4 uVar3;
int *piVar4;
code *pcVar5;
int iVar6;
char cVar7;
uint uVar8;
undefined *puVar9;
float local_7c;
float local_78;
float local_74;
CGameTrace local_70 [44];
float local_44;
char local_3a;
iVar6 = enginetrace;
uVar2 = *(undefined4 *)(enginetrace + 8);
*(char **)(enginetrace + 8) = "PhysicsToss";
uVar3 = *(undefined4 *)(iVar6 + 4);
*(CBaseEntity **)(iVar6 + 4) = this;
/* try { // try from 00478bde to 00478f2f has its CatchHandler @ 00478f35 */
PhysicsCheckWater(this);
uVar8 = *(uint *)(this + 0x14c);
if ((uVar8 & 0x400000) == 0) {
cVar7 = PhysicsRunThink();
if (cVar7 == '\0') goto LAB_00478e19;
uVar8 = *(uint *)(this + 0x14c);
}
if ((uVar8 & 0x1000) == 0) {
if (0.0 < *(float *)(this + 0x27c)) goto LAB_00478c0d;
LAB_00478e78:
uVar8 = *(uint *)(this + 600);
if ((((uVar8 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar9 + 8) != uVar8 >> 0xc)) ||
((*(CBaseEntity **)(puVar9 + 4) == (CBaseEntity *)0x0 ||
(cVar7 = IsStandable(*(CBaseEntity **)(puVar9 + 4)), cVar7 == '\0')))) goto LAB_00478c0d;
}
else {
CalcAbsoluteVelocity(this);
if (*(float *)(this + 0x27c) <= 0.0) goto LAB_00478e78;
LAB_00478c0d:
SetGroundEntity(this,(CBaseEntity *)0x0);
}
if (((byte)this[0x150] & 1) != 0) {
if (((byte)this[0x14d] & 0x10) != 0) {
CalcAbsoluteVelocity(this);
}
if (((vec3_origin == *(float *)(this + 0x274)) && (DAT_01053d4c == *(float *)(this + 0x278))) &&
((DAT_01053d50 == *(float *)(this + 0x27c) &&
(((SetLocalAngularVelocity(this,(QAngle *)&vec3_angle),
vec3_origin == *(float *)(this + 0x268) && (DAT_01053d4c == *(float *)(this + 0x26c))) &&
(DAT_01053d50 == *(float *)(this + 0x270))))))) goto LAB_00478e19;
}
PhysicsCheckVelocity(this);
if ((this[0x186] == (CBaseEntity)0x5) && (((byte)this[0x151] & 4) == 0)) {
PhysicsAddGravityMove(this,(Vector *)&local_7c);
}
else {
if (((byte)this[0x14d] & 0x10) != 0) {
CalcAbsoluteVelocity(this);
}
local_74 = *(float *)(gpGlobals + 0x10);
local_7c = (*(float *)(this + 0x274) + *(float *)(this + 0x268)) * local_74;
local_78 = (*(float *)(this + 0x278) + *(float *)(this + 0x26c)) * local_74;
local_74 = (*(float *)(this + 0x27c) + *(float *)(this + 0x270)) * local_74;
PhysicsCheckVelocity(this);
}
SimulateAngles(this,*(float *)(gpGlobals + 0x10));
PhysicsPushEntity(this,(Vector *)&local_7c,local_70);
piVar4 = *(int **)(this + 0x238);
if (piVar4 != (int *)0x0) {
pcVar5 = *(code **)(*piVar4 + 0x118);
uVar1 = *(undefined4 *)(gpGlobals + 0x10);
if (((byte)this[0x14d] & 8) != 0) {
CalcAbsolutePosition(this);
}
(*pcVar5)(piVar4,this + 0x2e0,&vec3_angle,1,uVar1);
}
PhysicsCheckVelocity(this);
if (local_3a == '\0') {
if ((**(byte **)(this + 0x30) & 2) == 0) {
if (local_44 != 1.0) {
PerformFlyCollisionResolution(this,local_70,(Vector *)&local_7c);
}
PhysicsCheckWaterTransition(this);
}
}
else {
SetAbsVelocity(this,(Vector *)&vec3_origin);
SetLocalAngularVelocity(this,(QAngle *)&vec3_angle);
}
LAB_00478e19:
*(undefined4 *)(iVar6 + 4) = uVar3;
*(undefined4 *)(iVar6 + 8) = uVar2;
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.