TestEntityTriggerIntersection_Accurate
0x00b213a0 · 1610 bytes · __regparm3
_ZL38TestEntityTriggerIntersection_AccurateP11CBaseEntityS0_
Decompiled
undefined (2 params)
/* TestEntityTriggerIntersection_Accurate(CBaseEntity*, CBaseEntity*) */
uint __regparm3 TestEntityTriggerIntersection_Accurate(CBaseEntity *param_1,CBaseEntity *param_2)
{
CBaseEntity *pCVar1;
code *pcVar2;
int *piVar3;
uint uVar4;
int iVar5;
undefined4 uVar6;
float fVar7;
float *pfVar8;
float *pfVar9;
undefined4 uVar10;
ushort *puVar11;
int iVar12;
undefined4 *puVar13;
CUtlMemory<collidelist_t,int> *local_10b4;
int local_10a4;
CBaseEntity *local_10a0;
int local_1090 [5];
float local_107c;
float local_1078;
float local_1074;
undefined4 local_1070;
undefined4 local_106c;
undefined4 local_1068;
undefined4 local_1064;
float local_105c;
float local_1058;
float local_1054;
float local_104c;
undefined4 local_1048;
float local_1044;
undefined4 local_103c;
undefined1 local_1038;
undefined1 local_1037;
undefined4 local_101c [13];
byte local_fe5;
uVar4 = CBaseEntity::Intersects(param_1,param_2);
if ((char)uVar4 != '\0') {
pCVar1 = param_2 + 0x194;
iVar5 = (**(code **)(*(int *)(param_2 + 0x194) + 0x2c))(pCVar1);
if (iVar5 == 2) {
pfVar8 = (float *)(**(code **)(*(int *)(param_2 + 0x194) + 8))(pCVar1);
pfVar9 = (float *)(**(code **)(*(int *)(param_2 + 0x194) + 4))(pCVar1);
if ((((byte)param_2[0x14d] & 8) != 0) &&
(CBaseEntity::CalcAbsolutePosition(param_2), ((byte)param_2[0x14d] & 8) != 0)) {
CBaseEntity::CalcAbsolutePosition(param_2);
}
local_106c = 0;
local_1068 = 0;
local_1037 = 0;
local_1064 = 0;
local_103c = 0;
local_104c = (*pfVar8 - *pfVar9) * 0.5;
local_1048 = (pfVar8[1] - pfVar9[1]) * 0.5;
local_1044 = (pfVar8[2] - pfVar9[2]) * 0.5;
local_1038 = local_1048 * local_1048 + local_104c * local_104c + local_1044 * local_1044 <
1e-06;
local_105c = (*pfVar8 + *pfVar9) * 0.5;
local_107c = *(float *)(param_2 + 0x2e0) + local_105c;
local_1058 = (pfVar8[1] + pfVar9[1]) * 0.5;
local_1078 = *(float *)(param_2 + 0x2e4) + local_1058;
local_1054 = (pfVar8[2] + pfVar9[2]) * 0.5;
local_105c = -local_105c;
local_1058 = -local_1058;
local_1074 = *(float *)(param_2 + 0x2e8) + local_1054;
local_1054 = -local_1054;
(**(code **)(*enginetrace + 0x10))
(enginetrace,&local_107c,0xffffffff,param_1 + 0x194,local_101c);
return (uint)local_fe5;
}
if ((iVar5 == 6) || (iVar5 == 1)) {
pcVar2 = *(code **)(*modelinfo + 0x18);
uVar6 = (**(code **)(*(int *)param_1 + 0x1c))(param_1);
iVar5 = (*pcVar2)(modelinfo,uVar6);
uVar6 = **(undefined4 **)(iVar5 + 4);
local_1090[0] = 0;
local_1090[1] = 0;
local_1090[2] = 0;
local_1090[3] = 0;
local_1090[4] = 0;
/* try { // try from 00b21481 to 00b2161b has its CatchHandler @ 00b21a05 */
iVar5 = (**(code **)(*(int *)param_2 + 0x2b8))(param_2,local_101c,0x400);
if (iVar5 == 0) {
pcVar2 = *(code **)(*modelinfo + 0x18);
/* try { // try from 00b21890 to 00b2195f has its CatchHandler @ 00b21a05 */
uVar10 = (**(code **)(*(int *)param_2 + 0x1c))(param_2);
puVar11 = (ushort *)(*pcVar2)(modelinfo,uVar10);
if ((puVar11 != (ushort *)0x0) && ((*puVar11 & 0x7fff) != 0)) {
local_107c = **(float **)(puVar11 + 2);
if (((byte)param_2[0x14d] & 8) == 0) {
local_1078 = *(float *)(param_2 + 0x2e0);
local_1074 = *(float *)(param_2 + 0x2e4);
local_1070 = *(undefined4 *)(param_2 + 0x2e8);
}
else {
/* try { // try from 00b219a7 to 00b219ff has its CatchHandler @ 00b21a05 */
CBaseEntity::CalcAbsolutePosition(param_2);
local_1078 = *(float *)(param_2 + 0x2e0);
local_1074 = *(float *)(param_2 + 0x2e4);
local_1070 = *(undefined4 *)(param_2 + 0x2e8);
if ((*(uint *)(param_2 + 0x14c) & 0x800) != 0) {
CBaseEntity::CalcAbsolutePosition(param_2);
}
}
local_106c = *(undefined4 *)(param_2 + 0x37c);
local_1068 = *(undefined4 *)(param_2 + 0x380);
local_1064 = *(undefined4 *)(param_2 + 900);
CUtlVector<collidelist_t,CUtlMemory<collidelist_t,int>>::InsertBefore
((CUtlVector<collidelist_t,CUtlMemory<collidelist_t,int>> *)local_1090,
local_1090[3],(collidelist_t *)&local_107c);
}
}
else {
iVar12 = 0;
if (0 < iVar5) {
do {
piVar3 = (int *)local_101c[iVar12];
fVar7 = (float)(**(code **)(*piVar3 + 300))(piVar3);
if (fVar7 != 0.0) {
piVar3 = (int *)local_101c[iVar12];
local_107c = fVar7;
(**(code **)(*piVar3 + 0xc4))(piVar3,&local_1078,&local_106c);
CUtlVector<collidelist_t,CUtlMemory<collidelist_t,int>>::InsertBefore
((CUtlVector<collidelist_t,CUtlMemory<collidelist_t,int>> *)local_1090,
local_1090[3],(collidelist_t *)&local_107c);
}
iVar12 = iVar12 + 1;
} while (iVar12 != iVar5);
}
}
local_10b4 = (CUtlMemory<collidelist_t,int> *)local_1090;
local_10a4 = local_1090[3] + -1;
if (-1 < local_10a4) {
iVar5 = local_10a4 * 0x1c;
do {
puVar13 = (undefined4 *)(local_1090[0] + iVar5);
pcVar2 = *(code **)(*physcollision + 0x8c);
if ((((byte)param_1[0x14d] & 8) != 0) &&
(CBaseEntity::CalcAbsolutePosition(param_1), ((byte)param_1[0x14d] & 8) != 0)) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
local_10a0 = param_1 + 0x37c;
(*pcVar2)(physcollision,puVar13 + 1,puVar13 + 1,*puVar13,puVar13 + 4,uVar6,param_1 + 0x2e0
,local_10a0,&local_107c);
if (local_1048._3_1_ != 0) {
local_1090[3] = 0;
CUtlMemory<collidelist_t,int>::Purge(local_10b4);
local_1090[4] = local_1090[0];
CUtlMemory<collidelist_t,int>::Purge(local_10b4);
return (uint)local_1048._3_1_;
}
local_10a4 = local_10a4 + -1;
iVar5 = iVar5 + -0x1c;
} while (local_10a4 != -1);
}
local_1090[3] = 0;
CUtlMemory<collidelist_t,int>::Purge(local_10b4);
local_1090[4] = local_1090[0];
CUtlMemory<collidelist_t,int>::Purge(local_10b4);
uVar4 = 0;
}
}
return uVar4;
}
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.