CBreakable::VPhysicsCollision
0x006b1df0 · 760 bytes · __thiscall
_ZN10CBreakable17VPhysicsCollisionEiP21gamevcollisionevent_t
Decompiled
undefined (3 params)
/* CBreakable::VPhysicsCollision(int, gamevcollisionevent_t*) */
void __thiscall
CBreakable::VPhysicsCollision(CBreakable *this,int param_1,gamevcollisionevent_t *param_2)
{
gamevcollisionevent_t *pgVar1;
float fVar2;
int iVar3;
int **ppiVar4;
longdouble lVar5;
int *local_e0;
undefined1 local_7c [108];
local_e0 = (int *)0x6b1e15;
CBaseEntity::VPhysicsCollision((CBaseEntity *)this,param_1,param_2);
local_e0 = (int *)0x6b1e2a;
(**(code **)(**(int **)(param_2 + 0x1c) + 4))();
pgVar1 = param_2 + param_1 * 4;
local_e0 = (int *)0x6b1e3d;
lVar5 = (longdouble)(**(code **)(**(int **)pgVar1 + 0x78))();
iVar3 = param_1 * 0xc;
fVar2 = (float)lVar5;
if ((((*(float *)(param_2 + iVar3 + 0x38) * fVar2 == vec3_origin) &&
(*(float *)(param_2 + iVar3 + 0x3c) * fVar2 == DAT_01053d4c)) &&
(fVar2 * *(float *)(param_2 + iVar3 + 0x40) == DAT_01053d50)) &&
(*(int **)(param_2 + (uint)(param_1 == 0) * 4) != (int *)0x0)) {
local_e0 = (int *)0x6b205d;
(**(code **)(**(int **)(param_2 + (uint)(param_1 == 0) * 4) + 0x78))();
}
if ((*(uint *)(this + 0x148) & 0x200) == 0) {
if ((*(uint *)(this + 0x148) & 0x400) != 0) {
return;
}
iVar3 = *(int *)(param_2 + ((param_1 == 0) + 0x18) * 4 + 8);
local_e0 = (int *)0x6b1f7d;
(**(code **)(*(int *)(this + 0x440) + 0x4c))();
local_e0 = (int *)param_1;
lVar5 = (longdouble)CalculateDefaultPhysicsDamage();
if ((float)lVar5 <= 0.0) {
return;
}
ppiVar4 = &local_e0;
if (*(int *)(this + 0x44c) == 0) {
local_e0 = *(int **)pgVar1;
(**(code **)(*local_e0 + 0x74))();
ppiVar4 = &local_e0;
}
}
else {
this[0x478] = (CBreakable)0x1;
iVar3 = *(int *)(param_2 + ((param_1 == 0) + 0x18) * 4 + 8);
ppiVar4 = (int **)&stack0xffffff24;
if (*(int *)(this + 0x44c) == 0) {
local_e0 = (int *)0x6b20ce;
(**(code **)(**(int **)pgVar1 + 0x74))();
ppiVar4 = (int **)&stack0xffffff24;
}
}
ppiVar4[2] = (int *)iVar3;
ppiVar4[1] = (int *)iVar3;
*ppiVar4 = (int *)local_7c;
ppiVar4[-1] = (int *)0x6b1f22;
CTakeDamageInfo::CTakeDamageInfo
((CTakeDamageInfo *)*ppiVar4,(CBaseEntity *)ppiVar4[1],(CBaseEntity *)ppiVar4[2],
(Vector *)ppiVar4[3],(Vector *)ppiVar4[4],(float)ppiVar4[5],(int)ppiVar4[6],
(int)ppiVar4[7],(Vector *)ppiVar4[8]);
ppiVar4[3] = (int *)param_1;
ppiVar4[2] = (int *)param_2;
*ppiVar4 = (int *)this;
ppiVar4[1] = (int *)local_7c;
ppiVar4[-1] = (int *)0x6b1f3c;
PhysCallbackDamage((CBaseEntity *)*ppiVar4,(CTakeDamageInfo *)ppiVar4[1],
(gamevcollisionevent_t *)ppiVar4[2],(int)ppiVar4[3]);
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.