CPhysicsProp::DrawDebugTextOverlays
0x007e41c0 · 1100 bytes · __thiscall
_ZN12CPhysicsProp21DrawDebugTextOverlaysEv
Decompiled
undefined (1 param)
/* CPhysicsProp::DrawDebugTextOverlays() */
int __thiscall CPhysicsProp::DrawDebugTextOverlays(CPhysicsProp *this)
{
int *piVar1;
char cVar2;
int iVar3;
undefined4 uVar4;
char *pcVar5;
int in_GS_OFFSET;
longdouble lVar6;
longdouble lVar7;
int local_230;
float local_22c;
float local_228;
char local_220 [512];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar3 = CBaseAnimating::DrawDebugTextOverlays((CBaseAnimating *)this);
if ((((byte)this[0x110] & 1) != 0) && (piVar1 = *(int **)(this + 0x238), piVar1 != (int *)0x0)) {
lVar6 = (longdouble)(**(code **)(*piVar1 + 0x78))(piVar1);
uVar4 = GetMassEquivalent((float)lVar6);
lVar6 = (longdouble)(**(code **)(**(int **)(this + 0x238) + 0x78))(*(int **)(this + 0x238));
lVar7 = (longdouble)(**(code **)(**(int **)(this + 0x238) + 0x78))(*(int **)(this + 0x238));
V_snprintf(local_220,0x200,"Mass: %.2f kg / %.2f lb (%s)",(double)(float)lVar7,
(double)((float)lVar6 * 2.2),uVar4);
CBaseEntity::EntityText((CBaseEntity *)this,iVar3,local_220,0.0,0xff,0xff,0xff,0xff);
lVar6 = (longdouble)
CalculateObjectStress
(*(IPhysicsObject **)(this + 0x238),(CBaseEntity *)this,
(vphysics_objectstress_t *)&local_22c);
V_snprintf(local_220,0x200,"Stress: %.2f (%.2f / %.2f)",(double)(float)lVar6,(double)local_22c,
(double)local_228);
CBaseEntity::EntityText((CBaseEntity *)this,iVar3 + 1,local_220,0.0,0xff,0xff,0xff,0xff);
local_230 = iVar3 + 2;
cVar2 = (**(code **)(**(int **)(this + 0x238) + 0x2c))(*(int **)(this + 0x238));
if (cVar2 == '\0') {
V_snprintf(local_220,0x200,"Motion Disabled");
CBaseEntity::EntityText((CBaseEntity *)this,local_230,local_220,0.0,0xff,0xff,0xff,0xff);
local_230 = iVar3 + 3;
}
if (*(int *)(this + 0x1490) != 0) {
V_snprintf(local_220,0x200,"Base PropData: %s",*(int *)(this + 0x1490));
CBaseEntity::EntityText((CBaseEntity *)this,local_230,local_220,0.0,0xff,0xff,0xff,0xff);
local_230 = local_230 + 1;
}
if (*(int *)(this + 0x14a0) != 0) {
(**(code **)(*(int *)(this + 0x13f4) + 0x6c))(this + 0x13f4);
V_snprintf(local_220,0x200,"Breakable Chunks: %d (Max Size %d)",*(undefined4 *)(this + 0x14a0)
);
CBaseEntity::EntityText((CBaseEntity *)this,local_230,local_220,0.0,0xff,0xff,0xff,0xff);
local_230 = local_230 + 1;
}
V_snprintf(local_220,0x200,"Skin: %d",*(undefined4 *)(this + 0x458));
CBaseEntity::EntityText((CBaseEntity *)this,local_230,local_220,0.0,0xff,0xff,0xff,0xff);
pcVar5 = "Awake";
if (this[0x167c] == (CPhysicsProp)0x0) {
pcVar5 = "Asleep";
}
V_snprintf(local_220,0x200,"Health: %d, collision group %d %s",*(undefined4 *)(this + 0x100),
*(undefined4 *)(this + 0x234),pcVar5);
CBaseEntity::EntityText((CBaseEntity *)this,local_230 + 1,local_220,0.0,0xff,0xff,0xff,0xff);
iVar3 = local_230 + 2;
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return iVar3;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.