PhysModelCreateUnmoveable
0x00492a10 · 750 bytes · __cdecl
_Z25PhysModelCreateUnmoveableP11CBaseEntityiRK6VectorRK6QAngle
Decompiled
undefined (4 params)
/* PhysModelCreateUnmoveable(CBaseEntity*, int, Vector const&, QAngle const&) */
int * PhysModelCreateUnmoveable(CBaseEntity *param_1,int param_2,Vector *param_3,QAngle *param_4)
{
code *pcVar1;
int **ppiVar2;
char cVar3;
int iVar4;
int *piVar5;
uint uVar6;
vcollide_t *pvVar7;
int iVar8;
int **ppiVar9;
int in_GS_OFFSET;
int *local_6a0;
undefined1 *local_670;
solid_t local_660 [1024];
char local_260;
undefined1 *local_34;
CBaseEntity *local_30;
undefined1 local_24;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (g_pPhys2World == (int *)0x0) {
LAB_00492b10:
local_6a0 = (int *)0x492b24;
pvVar7 = (vcollide_t *)(**(code **)(*modelinfo + 0x18))();
ppiVar2 = (int **)&stack0xfffff964;
if ((pvVar7 != (vcollide_t *)0x0) &&
(ppiVar2 = (int **)&stack0xfffff964, (*(ushort *)pvVar7 & 0x7fff) != 0)) {
local_6a0 = (int *)0x492b5b;
cVar3 = PhysModelParseSolidByIndex(local_660,param_1,pvVar7,-1);
ppiVar2 = (int **)&stack0xfffff964;
if (cVar3 != '\0') {
local_24 = 1;
if (local_260 != '\0') {
local_6a0 = (int *)0x492c9c;
(**(code **)(*physprops + 0x10))();
}
local_30 = param_1;
local_6a0 = (int *)0x492ba2;
(**(code **)(*(int *)param_1 + 0x20))();
ppiVar9 = &local_6a0;
local_34 = &DAT_00d539c2;
if (local_670 != (undefined1 *)0x0) {
local_34 = local_670;
}
local_6a0 = physenv;
piVar5 = (int *)(**(code **)(*physenv + 0x24))();
ppiVar2 = &local_6a0;
if (piVar5 != (int *)0x0) {
pcVar1 = *(code **)(*modelinfo + 0x2c);
local_6a0 = modelinfo;
(**(code **)(*modelinfo + 8))();
local_6a0 = modelinfo;
iVar4 = (*pcVar1)();
if (iVar4 == 1) {
local_6a0 = modelinfo;
iVar4 = (**(code **)(*modelinfo + 0x78))();
local_6a0 = piVar5;
iVar8 = (**(code **)(*piVar5 + 0xa4))();
if ((iVar4 != iVar8) && (iVar4 != 0)) {
local_6a0 = piVar5;
(**(code **)(*piVar5 + 0xa8))();
local_6a0 = piVar5;
(**(code **)(*piVar5 + 0x6c))();
}
}
local_6a0 = g_pPhysSaveRestoreManager;
(**(code **)(*g_pPhysSaveRestoreManager + 4))();
goto LAB_00492c3d;
}
}
}
}
else {
local_6a0 = (int *)0x492a4d;
iVar4 = (**(code **)(*g_pPhys2World + 0x6c))();
if (iVar4 < 1) goto LAB_00492b10;
local_6a0 = (int *)0x492a74;
piVar5 = (int *)Physics2ModelCreate(param_1,param_2,param_3,param_4,1);
if (piVar5 == (int *)0x0) {
local_6a0 = (int *)0x492c69;
uVar6 = (**(code **)(*(int *)(param_1 + 0x194) + 0x30))();
ppiVar2 = (int **)&stack0xfffff964;
if ((uVar6 & 0x1000) == 0) goto LAB_00492ab3;
}
else {
local_6a0 = (int *)0x492a84;
piVar5 = (int *)(**(code **)(*piVar5 + 0x60))();
local_6a0 = (int *)0x492a9c;
uVar6 = (**(code **)(*(int *)(param_1 + 0x194) + 0x30))();
ppiVar9 = (int **)&stack0xfffff964;
if (((uVar6 & 0x1000) != 0) || (ppiVar9 = (int **)&stack0xfffff964, piVar5 != (int *)0x0))
goto LAB_00492c3d;
LAB_00492ab3:
local_6a0 = (int *)0x492ace;
CBaseEntity::GetDebugName(param_1);
local_6a0 = (int *)0x492aef;
Warning();
local_6a0 = (int *)0x492b04;
iVar4 = (**(code **)(*g_pPhys2World + 0x6c))();
ppiVar2 = (int **)&stack0xfffff964;
if (iVar4 < 5) goto LAB_00492b10;
}
}
ppiVar9 = ppiVar2;
piVar5 = (int *)0x0;
LAB_00492c3d:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return piVar5;
}
/* WARNING: Subroutine does not return */
*(undefined **)((int)ppiVar9 + -4) = &UNK_00492d05;
__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.