PhysModelCreateBox
0x004948c0 · 573 bytes · __cdecl
_Z18PhysModelCreateBoxP11CBaseEntityRK6VectorS3_S3_b
Decompiled
undefined (5 params)
/* PhysModelCreateBox(CBaseEntity*, Vector const&, Vector const&, Vector const&, bool) */
undefined4
PhysModelCreateBox(CBaseEntity *param_1,Vector *param_2,Vector *param_3,Vector *param_4,bool param_5
)
{
IMDLCache *pIVar1;
int iVar2;
studiohdr_t *psVar3;
char *pcVar4;
CPhysCollide *pCVar5;
undefined4 uVar6;
undefined1 *puVar7;
int in_GS_OFFSET;
char *local_6d0;
int local_6c8 [2];
undefined4 local_6c0 [3];
undefined4 local_6b4;
undefined4 local_6b0;
undefined4 local_69c [3];
undefined4 local_690;
undefined4 local_68c;
undefined4 local_688 [3];
undefined4 local_67c;
undefined4 local_678;
solid_t local_660 [1024];
char local_260 [564];
float local_2c;
int local_20;
puVar7 = &stack0xfffff904;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar2 = (**(code **)(*(int *)param_1 + 0x1c))();
PhysGetDefaultAABBSolid(local_660);
local_2c = (*(float *)(param_3 + 4) - *(float *)(param_2 + 4)) *
(*(float *)param_3 - *(float *)param_2) *
(*(float *)(param_3 + 8) - *(float *)(param_2 + 8));
if (iVar2 != 0) {
iVar2 = (**(code **)(*modelinfo + 8))();
pIVar1 = mdlcache;
if (iVar2 != 0) {
psVar3 = (studiohdr_t *)(**(code **)(*modelinfo + 0x7c))();
CStudioHdr::CStudioHdr((CStudioHdr *)local_6c8,psVar3,pIVar1);
if (local_6c8[0] == 0) {
pcVar4 = "flesh";
}
else {
/* try { // try from 004949a0 to 004949a4 has its CatchHandler @ 00494b09 */
pcVar4 = (char *)Studio_GetDefaultSurfaceProps((CStudioHdr *)local_6c8);
}
CStudioHdr::Term((CStudioHdr *)local_6c8);
local_67c = 0;
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)local_688);
local_678 = local_688[0];
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)local_688);
local_690 = 0;
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)local_69c);
local_68c = local_69c[0];
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)local_69c);
local_6b4 = 0;
CUtlMemory<studiohdr_t_const*,int>::Purge((CUtlMemory<studiohdr_t_const*,int> *)local_6c0);
local_6b0 = local_6c0[0];
CUtlMemory<studiohdr_t_const*,int>::Purge((CUtlMemory<studiohdr_t_const*,int> *)local_6c0);
goto LAB_00494a45;
}
}
pcVar4 = "flesh";
LAB_00494a45:
V_strncpy(local_260,pcVar4,0x200);
pCVar5 = (CPhysCollide *)PhysCreateBbox(param_2,param_3);
if (pCVar5 == (CPhysCollide *)0x0) {
uVar6 = 0;
}
else {
(**(code **)(*(int *)param_1 + 0x20))();
puVar7 = &stack0xfffff900;
pcVar4 = "";
if (local_6d0 != (char *)0x0) {
pcVar4 = local_6d0;
}
uVar6 = PhysModelCreateCustom
(param_1,pCVar5,param_4,(QAngle *)&vec3_angle,pcVar4,param_5,local_660);
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar6;
}
/* WARNING: Subroutine does not return */
*(undefined1 **)(puVar7 + -4) = &LAB_00494b09;
__stack_chk_fail();
}
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.