CBaseEntity::PhysicsAddHalfGravity
0x0078e370 · 705 bytes · __thiscall
_ZN11CBaseEntity21PhysicsAddHalfGravityEf
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBaseEntity::PhysicsAddHalfGravity(float) */
void __thiscall CBaseEntity::PhysicsAddHalfGravity(CBaseEntity *this,float param_1)
{
undefined4 uVar1;
undefined4 uVar2;
int iVar3;
char cVar4;
int iVar5;
float local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
int local_2c;
undefined4 local_28;
undefined4 local_24;
float local_20;
local_3c = 0;
local_38 = 0;
if (___atan2f_finite == 0) {
local_2c = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_3c,0,0,0,0,"/data/src/game/server/physics_main.cpp",0x507,
&PhysicsAddHalfGravity(float)::tm_fmt,"(%s)%s","Unaccounted",
"CBaseEntity::PhysicsAddHalfGravity");
local_2c = ___atan2f_finite;
}
iVar3 = _DAT_0105db00;
local_34 = local_3c;
local_30 = local_38;
if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
/* try { // try from 0078e5a6 to 0078e5f4 has its CatchHandler @ 0078e664 */
iVar5 = ThreadGetCurrentId();
if (iVar3 == iVar5) {
if ((char *)*_DAT_0105d15c != "CBaseEntity::PhysicsAddHalfGravity") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcb22d8,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
}
local_40 = *(float *)(this + 0x2c0);
if (local_40 == 0.0) {
local_40 = 1.0;
}
if (((byte)this[0x14d] & 0x10) != 0) {
/* try { // try from 0078e452 to 0078e50c has its CatchHandler @ 0078e643 */
CalcAbsoluteVelocity(this);
}
local_28 = *(undefined4 *)(this + 0x274);
local_24 = *(undefined4 *)(this + 0x278);
local_20 = (*(float *)(this + 0x27c) -
*(float *)(sv_gravity._28_4_ + 0x2c) * 0.5 * param_1 * local_40) +
*(float *)(this + 0x270) * *(float *)(gpGlobals + 0x10);
SetAbsVelocity(this,(Vector *)&local_28);
uVar1 = *(undefined4 *)(this + 0x268);
uVar2 = *(undefined4 *)(this + 0x26c);
if (*(float *)(this + 0x270) != 0.0) {
/* try { // try from 0078e610 to 0078e615 has its CatchHandler @ 0078e643 */
(**(code **)(*(int *)this + 0x2fc))(this,this + 0x268);
*(undefined4 *)(this + 0x268) = uVar1;
*(undefined4 *)(this + 0x26c) = uVar2;
*(undefined4 *)(this + 0x270) = 0;
}
PhysicsCheckVelocity(this);
iVar3 = _DAT_0105db00;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
iVar5 = ThreadGetCurrentId();
if (iVar3 == iVar5) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (local_2c != 0) {
(**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
}
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.