CPhysicsProp::HandleAnyCollisionInteractions
0x007f0d70 · 1536 bytes · __thiscall
_ZN12CPhysicsProp30HandleAnyCollisionInteractionsEiP21gamevcollisionevent_t
Decompiled
undefined (3 params)
/* CPhysicsProp::HandleAnyCollisionInteractions(int, gamevcollisionevent_t*) */
void __thiscall
CPhysicsProp::HandleAnyCollisionInteractions
(CPhysicsProp *this,int param_1,gamevcollisionevent_t *param_2)
{
gamevcollisionevent_t *pgVar1;
float fVar2;
float fVar3;
IPhysicsObject *pIVar4;
CBaseEdict *this_00;
char cVar5;
int iVar6;
CBaseAnimating *this_01;
uint uVar7;
longdouble lVar8;
float fVar9;
Vector *this_02;
int local_114;
float local_10c;
float local_108;
float local_104;
QAngle local_100 [12];
float local_f4;
undefined4 local_f0;
undefined4 local_ec;
undefined4 local_e8;
undefined4 local_e4;
undefined4 local_e0;
undefined4 local_dc;
undefined4 local_d8;
undefined4 local_d4;
float local_cc;
float local_c8;
float local_c4;
float local_bc;
float local_b8;
float local_b4;
undefined4 local_ac;
undefined4 local_a8;
undefined4 local_a4;
undefined4 local_9c;
undefined4 local_98;
undefined4 local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
float local_70;
float local_6c;
float local_68;
undefined4 local_64;
undefined4 local_60;
undefined4 local_5c;
int local_20;
cVar5 = (**(code **)(*(int *)this + 0x440))(this,3);
if (cVar5 != '\0') {
pgVar1 = param_2 + param_1 * 0xc + 0x20;
fVar9 = *(float *)pgVar1;
fVar2 = *(float *)(pgVar1 + 4);
fVar3 = *(float *)(pgVar1 + 8);
cVar5 = GetPropDataAngles(this,"impale_forward",local_100);
if (cVar5 == '\0') {
this_02 = (Vector *)this;
(**(code **)(*(int *)this + 0x24c))(this,&local_10c,0,0);
}
else {
this_02 = (Vector *)&local_70;
AngleVectors(local_100,this_02);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
VectorRotate((float *)this_02,(matrix3x4_t *)(this + 0x28c),&local_10c);
}
if (1000.0 <= fVar2 * local_108 + fVar9 * local_10c + fVar3 * local_104) {
if (*(int *)(param_2 + ((param_1 == 0) + 0x18) * 4 + 8) == g_WorldEntity) {
fVar9 = 1.0;
if (param_1 != 0) {
fVar9 = -1.0;
}
(**(code **)**(undefined4 **)(param_2 + 0x1c))(*(undefined4 **)(param_2 + 0x1c),&local_70);
if (0.70710677 <=
(local_6c * local_108 + local_70 * local_10c + local_68 * local_104) * fVar9) {
CBreakableProp::HandleInteractionStick((CBreakableProp *)this,param_1,param_2);
}
}
else {
iVar6 = CBaseEntity::MyNPCPointer();
if (iVar6 != 0) {
this_01 = (CBaseAnimating *)CBaseEntity::MyNPCPointer();
pIVar4 = *(IPhysicsObject **)(this + 0x238);
iVar6 = (**(code **)(*(int *)this + 0x2c4))(this,0x41c80000);
if ((iVar6 != 0) &&
(iVar6 = (**(code **)(*(int *)this_01 + 0x4f4))(this_01,iVar6), iVar6 == 3)) {
return;
}
(**(code **)(*(int *)pIVar4 + 0xc4))(pIVar4,&local_f4,0);
local_8c = 0;
local_88 = 1;
local_bc = *(float *)pgVar1 * 1.5;
local_b8 = *(float *)(pgVar1 + 4) * 1.5;
local_b4 = *(float *)(pgVar1 + 8) * 1.5;
local_94 = 0;
local_98 = 0;
local_9c = 0;
local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
local_a4 = 0;
local_a8 = 0;
local_ac = 0;
local_cc = local_f4;
local_c8 = (float)local_f0;
local_c4 = (float)local_ec;
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)&local_dc,(IHandleEntity *)this,0,
(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))
(enginetrace,&local_cc,0x46004003,&local_dc,(Vector *)&local_70);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine((Vector *)&local_70,(Vector *)&local_64,0xff,0,0,true,-1.0);
}
local_114 = -1;
local_e8 = local_64;
local_e4 = local_60;
local_e0 = local_5c;
if (local_20 != 0) {
local_114 = CBaseAnimating::GetHitboxBone(this_01,local_20);
CBaseAnimating::GetBonePosition
(this_01,local_114,(Vector *)&local_dc,(QAngle *)&local_cc);
(**(code **)(*(int *)this + 0x1dc))(this,&local_dc,0,0);
local_e8 = local_dc;
local_e4 = local_d8;
local_e0 = local_d4;
}
(**(code **)(**(int **)(param_2 + 0x1c) + 4))
(*(int **)(param_2 + 0x1c),(Vector *)&local_e8);
iVar6 = CreateServerRagdollAttached
(this_01,(Vector *)&vec3_origin,-1,3,pIVar4,(CBaseAnimating *)this,0,
(Vector *)&local_e8,local_114,(Vector *)&vec3_origin);
if (iVar6 != 0) {
lVar8 = (longdouble)(**(code **)(*(int *)pIVar4 + 0x78))(pIVar4);
local_c4 = (float)lVar8;
local_cc = *(float *)pgVar1 * local_c4;
local_c8 = *(float *)(pgVar1 + 4) * local_c4;
local_c4 = local_c4 * *(float *)(pgVar1 + 8);
PhysCallbackImpulse(pIVar4,(Vector *)&local_cc,(Vector *)&vec3_origin);
UTIL_Remove((CBaseEntity *)this_01);
uVar7 = *(uint *)(this + 0x148) | 0x800;
if (*(uint *)(this + 0x148) != uVar7) {
if (this[0x6c] == (CPhysicsProp)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CPhysicsProp)((byte)this[0x70] | 1);
}
*(uint *)(this + 0x148) = uVar7;
}
}
}
}
}
else if (((byte)this[0x149] & 8) != 0) {
CBreakableProp::CheckRemoveRagdolls((CBreakableProp *)this_02);
}
}
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.