CEngineTrace::ClipRayToVPhysics
0x0015a030 · 1185 bytes · __thiscall
_ZN12CEngineTrace17ClipRayToVPhysicsERK5Ray_tjP12ICollideableP11studiohdr_tP10CGameTrace
Decompiled
undefined (6 params)
/* CEngineTrace::ClipRayToVPhysics(Ray_t const&, unsigned int, ICollideable*, studiohdr_t*,
CGameTrace*) */
undefined4 __thiscall
CEngineTrace::ClipRayToVPhysics
(CEngineTrace *this,Ray_t *param_1,uint param_2,ICollideable *param_3,studiohdr_t *param_4
,CGameTrace *param_5)
{
float fVar1;
float fVar2;
float fVar3;
char cVar4;
int iVar5;
model_t *pmVar6;
undefined4 uVar7;
int *piVar8;
int iVar9;
undefined4 uVar10;
ushort *puVar11;
undefined4 uVar12;
uint uVar13;
float *pfVar14;
code *pcVar15;
longlong lVar16;
undefined8 uVar17;
undefined8 in_stack_ffffffb0;
undefined ***local_30;
undefined **local_28;
studiohdr_t *local_24;
uVar12 = (undefined4)((ulonglong)in_stack_ffffffb0 >> 0x20);
iVar5 = (**(code **)(*(int *)param_3 + 0x2c))(param_3);
if (iVar5 != 6) {
return 0;
}
pmVar6 = (model_t *)(**(code **)(*(int *)param_3 + 0x1c))(param_3);
if (pmVar6 == (model_t *)0x0) {
piVar8 = (int *)(**(code **)(*(int *)param_3 + 0x48))(param_3);
if ((piVar8 == (int *)0x0) || (uVar13 = (**(code **)(*piVar8 + 300))(piVar8), uVar13 == 0)) {
pfVar14 = (float *)(**(code **)(*(int *)param_3 + 4))(param_3);
fVar1 = *pfVar14;
fVar2 = pfVar14[1];
fVar3 = pfVar14[2];
pfVar14 = (float *)(**(code **)(*(int *)param_3 + 8))(param_3);
Warning("CEngineTrace::ClipRayToVPhysics : no model; bbox {%g,%g,%g}-{%g,%g,%g}\n",
(double)fVar1,(double)fVar2,(double)fVar3,(double)*pfVar14,(double)pfVar14[1],
(double)pfVar14[2]);
return 0;
}
pcVar15 = *(code **)(*physcollision + 0x88);
uVar7 = (**(code **)(*(int *)param_3 + 0x24))(param_3);
uVar10 = (**(code **)(*(int *)param_3 + 0x20))(param_3);
lVar16 = (ulonglong)uVar13 << 0x20;
uVar17 = CONCAT44(uVar7,uVar10);
}
else {
if (param_4 == (studiohdr_t *)0x0) {
if (param_1[0x44] == (Ray_t)0x0) {
local_30 = &local_28;
if (*(int *)(pmVar6 + 0x110) != 1) {
local_30 = (undefined ***)0x0;
}
}
else {
if (*(int *)(pmVar6 + 0x110) == 1) {
return 0;
}
local_30 = (undefined ***)0x0;
}
local_24 = (studiohdr_t *)&g_BSPData;
local_28 = &PTR_GetContents_002af008;
iVar5 = (**(code **)(*(int *)param_3 + 0x18))(param_3);
if ((g_pPhysics2 == (int *)0x0) ||
(iVar9 = (**(code **)(*g_pPhysics2 + 0x5c))(g_pPhysics2,0), iVar9 < 4)) {
puVar11 = (ushort *)CM_VCollideForModel(iVar5,pmVar6);
if (puVar11 == (ushort *)0x0) {
return 0;
}
if ((*puVar11 & 0x7fff) == 0) {
return 0;
}
pcVar15 = *(code **)(*physcollision + 0x88);
uVar7 = (**(code **)(*(int *)param_3 + 0x24))(param_3);
uVar10 = (**(code **)(*(int *)param_3 + 0x20))(param_3);
uVar17 = CONCAT44(uVar7,uVar10);
iVar5 = **(int **)(puVar11 + 2);
}
else {
iVar5 = CM_Physics2VCollideForModel(iVar5,pmVar6);
if ((iVar5 == 0) || (*(short *)(iVar5 + 2) == 0)) {
return 0;
}
pcVar15 = *(code **)(*physcollision + 0xf4);
uVar7 = (**(code **)(*(int *)param_3 + 0x24))(param_3);
uVar10 = (**(code **)(*(int *)param_3 + 0x20))(param_3);
uVar17 = CONCAT44(uVar7,uVar10);
}
}
else {
uVar7 = (*(code *)**(undefined4 **)param_3)(param_3);
piVar8 = (int *)StaticPropMgr();
cVar4 = (**(code **)(*piVar8 + 0x28))(piVar8,uVar7);
if (cVar4 != '\0') {
piVar8 = (int *)StaticPropMgr();
uVar7 = (**(code **)(*piVar8 + 0x40))(piVar8,&local_28,uVar7);
if ((char)uVar7 != '\0') {
pcVar15 = *(code **)(*physcollision + 0xf8);
uVar12 = (**(code **)(*(int *)param_3 + 0x24))(param_3);
uVar10 = (**(code **)(*(int *)param_3 + 0x20))(param_3);
(*pcVar15)(physcollision,param_1,param_2,&local_28,uVar10,uVar12,param_5);
return uVar7;
}
}
if (((g_pPhysics2 != (int *)0x0) &&
(iVar5 = (**(code **)(*g_pMDLCache + 0x34))(g_pMDLCache,*(undefined2 *)(pmVar6 + 0x134),1)
, iVar5 != 0)) && (iVar9 = (**(code **)(*g_pPhysics2 + 0x5c))(g_pPhysics2,0), -1 < iVar9))
{
local_28 = &PTR_GetContents_002af028;
local_24 = param_4;
pcVar15 = *(code **)(*physcollision + 0xf4);
uVar7 = (**(code **)(*(int *)param_3 + 0x24))(param_3);
uVar10 = (**(code **)(*(int *)param_3 + 0x20))(param_3);
(*pcVar15)(physcollision,param_1,param_2,&local_28,iVar5,uVar10,uVar7,param_5);
iVar5 = (**(code **)(*g_pPhysics2 + 0x5c))(g_pPhysics2,0);
if (2 < iVar5) {
return 1;
}
}
puVar11 = (ushort *)
(**(code **)(*g_pMDLCache + 0x30))(g_pMDLCache,*(undefined2 *)(pmVar6 + 0x134));
if (puVar11 == (ushort *)0x0) {
return 0;
}
if ((*puVar11 & 0x7fff) == 0) {
return 0;
}
if (*(int *)(puVar11 + 2) == 0) {
return 0;
}
local_28 = &PTR_GetContents_002af018;
local_24 = param_4;
pcVar15 = *(code **)(*physcollision + 0x88);
uVar7 = (**(code **)(*(int *)param_3 + 0x24))(param_3);
uVar10 = (**(code **)(*(int *)param_3 + 0x20))(param_3);
uVar17 = CONCAT44(uVar7,uVar10);
iVar5 = **(int **)(puVar11 + 2);
local_30 = &local_28;
}
lVar16 = CONCAT44(iVar5,local_30);
}
(*pcVar15)(physcollision,param_1,param_2,lVar16,uVar17,CONCAT44(uVar12,param_5));
return 1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.