ShouldRemoveThisRagdoll
0x0051ccb0 · 524 bytes · __cdecl
_Z23ShouldRemoveThisRagdollP14CBaseAnimating
Decompiled
undefined (1 param)
/* ShouldRemoveThisRagdoll(CBaseAnimating*) */
undefined1 ShouldRemoveThisRagdoll(CBaseAnimating *param_1)
{
char cVar1;
int *piVar2;
int iVar3;
int iVar4;
undefined4 local_28;
undefined4 local_24;
float local_20;
if (g_RagdollLVManager == '\0') {
if (param_1 == (CBaseAnimating *)0x0) {
Msg("ALERT: why is Ragdoll pointer null?");
return 0;
}
piVar2 = (int *)UTIL_GetLocalPlayer();
iVar3 = UTIL_FindClientInPVS(*(edict_t **)(param_1 + 0x30));
if (iVar3 == 0) {
if (*(int *)(g_debug_ragdoll_removal._28_4_ + 0x30) == 0) {
return 1;
}
if (((byte)param_1[0x14d] & 8) == 0) {
local_28 = *(undefined4 *)(param_1 + 0x2e0);
local_24 = *(undefined4 *)(param_1 + 0x2e4);
local_20 = *(float *)(param_1 + 0x2e8) + 64.0;
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
local_28 = *(undefined4 *)(param_1 + 0x2e0);
local_24 = *(undefined4 *)(param_1 + 0x2e4);
local_20 = *(float *)(param_1 + 0x2e8) + 64.0;
if ((*(uint *)(param_1 + 0x14c) & 0x800) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
}
iVar4 = 0;
iVar3 = 0xff;
}
else {
cVar1 = (**(code **)(*piVar2 + 0x3c8))(piVar2,param_1);
if (cVar1 != '\0') {
return 0;
}
if (*(int *)(g_debug_ragdoll_removal._28_4_ + 0x30) == 0) {
return 1;
}
if (((byte)param_1[0x14d] & 8) == 0) {
local_28 = *(undefined4 *)(param_1 + 0x2e0);
local_24 = *(undefined4 *)(param_1 + 0x2e4);
local_20 = *(float *)(param_1 + 0x2e8) + 64.0;
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
local_28 = *(undefined4 *)(param_1 + 0x2e0);
local_24 = *(undefined4 *)(param_1 + 0x2e4);
local_20 = *(float *)(param_1 + 0x2e8) + 64.0;
if ((*(uint *)(param_1 + 0x14c) & 0x800) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
}
iVar4 = 0xff;
iVar3 = 0;
}
NDebugOverlay::Line((Vector *)(param_1 + 0x2e0),(Vector *)&local_28,0,iVar3,iVar4,true,5.0);
}
return 1;
}
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.