CCollisionEvent::ShouldSolvePenetration
0x0077e230 · 745 bytes · __cdecl
_ZN15CCollisionEvent22ShouldSolvePenetrationEP14IPhysicsObjectS1_PvS2_f
Decompiled
undefined (5 params)
/* CCollisionEvent::ShouldSolvePenetration(IPhysicsObject*, IPhysicsObject*, void*, void*, float) */
undefined4
CCollisionEvent::ShouldSolvePenetration
(IPhysicsObject *param_1,IPhysicsObject *param_2,void *param_3,void *param_4,float param_5
)
{
IPhysicsObject *pIVar1;
char cVar2;
undefined2 uVar3;
undefined2 uVar4;
int iVar5;
int iVar6;
undefined4 uVar7;
uint uVar8;
undefined4 uVar9;
float extraout_EDX;
float extraout_EDX_00;
float extraout_EDX_01;
float fVar10;
float extraout_EDX_02;
float extraout_EDX_03;
CBaseEntity *this;
bool bVar11;
float fVar12;
undefined8 uVar13;
bVar11 = g_PhysicsHook[0x58] == '\0';
iVar5 = *(int *)(param_1 + 0x15c) + 1;
*(int *)(param_1 + 0x15c) = iVar5;
if (bVar11) {
this = param_4;
if ((uint)param_5 < param_4) {
pIVar1 = param_3;
param_3 = param_2;
this = (CBaseEntity *)param_5;
param_5 = (float)param_4;
param_2 = pIVar1;
}
if ((this == (CBaseEntity *)param_5) &&
(uVar8 = (**(code **)(*(int *)param_2 + 0x50))(param_2), (uVar8 & 8) != 0)) {
uVar3 = (**(code **)(*(int *)param_3 + 0x58))(param_3);
uVar4 = (**(code **)(*(int *)param_2 + 0x58))(param_2);
uVar7 = CBaseEntity::GetDebugName(this);
uVar9 = (**(code **)(*(int *)param_2 + 0x130))(param_2);
DevMsg(2,"Solving ragdoll self penetration! %s (%s) (%d v %d)\n",uVar9,uVar7,uVar4,uVar3);
iVar5 = Ragdoll_GetRagdoll(this);
(**(code **)(**(int **)(iVar5 + 8) + 0x1c))(*(int **)(iVar5 + 8),param_2,param_3);
LAB_0077e460:
iVar5 = *(int *)(param_1 + 0x15c);
uVar7 = 0;
goto LAB_0077e37f;
}
/* try { // try from 0077e279 to 0077e536 has its CatchHandler @ 0077e53c */
iVar5 = FindOrAddPenetrateEvent((CCollisionEvent *)param_1,this,(CBaseEntity *)param_5);
fVar12 = *(float *)(gpGlobals + 0xc) - *(float *)(iVar5 + 8);
iVar6 = CBaseEntity::MyNPCPointer();
if ((iVar6 == 0) ||
(cVar2 = CanResolvePenetrationWithNPC((CBaseEntity *)param_5,param_3), fVar10 = extraout_EDX,
cVar2 == '\0')) {
uVar13 = CBaseEntity::MyNPCPointer();
fVar10 = (float)((ulonglong)uVar13 >> 0x20);
if (((int)uVar13 != 0) &&
(cVar2 = CanResolvePenetrationWithNPC(this,param_2), fVar10 = extraout_EDX_02,
cVar2 != '\0')) goto LAB_0077e2b9;
}
else {
LAB_0077e2b9:
*(undefined4 *)(iVar5 + 0x10) = 2;
}
if ((((*(int *)(this + 0x234) - 1U < 3) &&
(cVar2 = (**(code **)(*(int *)param_3 + 8))(param_3), fVar10 = extraout_EDX_00,
cVar2 == '\0')) ||
((*(int *)((int)param_5 + 0x234) - 1U < 3 &&
(cVar2 = (**(code **)(*(int *)param_2 + 8))(param_2), fVar10 = extraout_EDX_01,
cVar2 == '\0')))) && (0.5 < fVar12)) {
*(undefined4 *)(iVar5 + 0x10) = 3;
}
if (3.0 < fVar12) {
if ((this != (CBaseEntity *)param_5) && (1 < *(int *)(*(int *)(g_pDeveloper + 0x1c) + 0x30)))
{
if (this[0x186] == (CBaseEntity)0x6) {
ReportPenetration(this,fVar10);
fVar10 = extraout_EDX_03;
}
if (*(CBaseEntity *)((int)param_5 + 0x186) == (CBaseEntity)0x6) {
ReportPenetration((CBaseEntity *)param_5,fVar10);
}
}
*(undefined4 *)(iVar5 + 8) = *(undefined4 *)(gpGlobals + 0xc);
cVar2 = (**(code **)(*(int *)this + 0x16c))(this);
if ((((cVar2 == '\0') &&
(cVar2 = (**(code **)(*(int *)param_5 + 0x16c))(param_5), cVar2 == '\0')) &&
(iVar6 = (**(code **)(*(int *)param_2 + 0x120))(param_2), iVar6 == 0)) &&
(iVar6 = (**(code **)(*(int *)param_3 + 0x120))(param_3), iVar6 == 0)) {
*(undefined4 *)(iVar5 + 0x10) = 1;
goto LAB_0077e460;
}
}
iVar5 = *(int *)(param_1 + 0x15c);
}
uVar7 = 1;
LAB_0077e37f:
*(int *)(param_1 + 0x15c) = iVar5 + -1;
return uVar7;
}
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.