Physics_SimulateEntity
0x007906f0 · 858 bytes · __cdecl
_Z22Physics_SimulateEntityP11CBaseEntity
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* Physics_SimulateEntity(CBaseEntity*) */
void Physics_SimulateEntity(CBaseEntity *param_1)
{
code *pcVar1;
uint uVar2;
int iVar3;
char cVar4;
int *piVar5;
int iVar6;
char *pcVar7;
undefined *puVar8;
undefined1 *puVar9;
longdouble lVar10;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_34 = 0;
local_30 = 0;
if (___atan2f_finite == 0) {
local_20 = 0;
}
else {
pcVar7 = "Physics_SimulateEntity";
pcVar1 = *(code **)(___atan2f_finite + 0x50);
if (*(int *)(vprof_scope_entity_gamephys._28_4_ + 0x30) != 0) {
piVar5 = (int *)EntityFactoryDictionary();
puVar9 = &DAT_00d539c2;
if (*(undefined1 **)(param_1 + 0x7c) != (undefined1 *)0x0) {
puVar9 = *(undefined1 **)(param_1 + 0x7c);
}
pcVar7 = (char *)(**(code **)(*piVar5 + 0x10))(piVar5,puVar9);
}
(*pcVar1)(___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/physics_main.cpp",0x80f,
&Physics_SimulateEntity(CBaseEntity*)::tm_fmt,"(%s)%s","Unaccounted",pcVar7);
local_20 = ___atan2f_finite;
}
local_28 = local_34;
local_24 = local_30;
if (*(int *)(vprof_scope_entity_gamephys._28_4_ + 0x30) == 0) {
pcVar7 = "Physics_SimulateEntity";
}
else {
/* try { // try from 007907ad to 007907cc has its CatchHandler @ 00790a77 */
piVar5 = (int *)EntityFactoryDictionary();
puVar9 = &DAT_00d539c2;
if (*(undefined1 **)(param_1 + 0x7c) != (undefined1 *)0x0) {
puVar9 = *(undefined1 **)(param_1 + 0x7c);
}
pcVar7 = (char *)(**(code **)(*piVar5 + 0x10))(piVar5,puVar9);
}
iVar3 = _DAT_0105db00;
/* try { // try from 007908ae to 007908f4 has its CatchHandler @ 00790a77 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar6 = ThreadGetCurrentId(), iVar3 == iVar6)) {
if (pcVar7 != (char *)*_DAT_0105d15c) {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,(int)pcVar7,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
if (*(int *)(param_1 + 0x30) == 0) {
/* try { // try from 00790a3b to 00790a3f has its CatchHandler @ 00790a8c */
CBaseEntity::PhysicsRunThink(param_1,0);
}
else {
if (param_1[0x3c4] != (CBaseEntity)0x0) {
uVar2 = *(uint *)(param_1 + 0x3c8);
/* try { // try from 00790956 to 0079095a has its CatchHandler @ 00790a8c */
if (((uVar2 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar8 + 8) == uVar2 >> 0xc &&
((*(CBasePlayer **)(puVar8 + 4) != (CBasePlayer *)0x0 &&
(lVar10 = (longdouble)CBasePlayer::GetTimeBase(*(CBasePlayer **)(puVar8 + 4)),
iVar3 = _DAT_0105db00, *(float *)(gpGlobals + 0xc) - 1.0 < (float)lVar10)))))) {
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar6 = ThreadGetCurrentId(), iVar3 == iVar6)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 == 0) {
return;
}
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
return;
}
/* try { // try from 00790832 to 00790841 has its CatchHandler @ 00790a8c */
CBaseEntity::UnsetPlayerSimulated(param_1);
}
(**(code **)(*(int *)param_1 + 0x1c8))(param_1);
}
iVar3 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar6 = ThreadGetCurrentId(), iVar3 == iVar6)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,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.