Mod_LoadSubmodels
0x0019cef0 · 610 bytes · __cdecl
_Z17Mod_LoadSubmodelsR10CUtlVectorI8mmodel_t10CUtlMemoryIS0_iEE
Decompiled
undefined (1 param)
/* Mod_LoadSubmodels(CUtlVector<mmodel_t, CUtlMemory<mmodel_t, int> >&) */
void Mod_LoadSubmodels(CUtlVector *param_1)
{
uint uVar1;
int iVar2;
int iVar3;
int iVar4;
int iVar5;
int in_GS_OFFSET;
float fVar6;
float fVar7;
uint local_158;
float local_14c [3];
uint local_140 [3];
int local_134;
int local_130;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
CMapLoadHelper::CMapLoadHelper((CMapLoadHelper *)local_140,0xe);
if (local_140[0] != (local_140[0] / 0x30) * 0x30) {
/* try { // try from 0019cf51 to 0019cf55 has its CatchHandler @ 0019d152 */
Host_Error("Mod_LoadSubmodels: funny lump size in %s",s_szMapPathName);
}
*(undefined4 *)(param_1 + 0xc) = 0;
uVar1 = local_140[0] / 0x30;
if (uVar1 == 0) {
*s_pMap = 0;
}
else {
CUtlVector<mmodel_t,CUtlMemory<mmodel_t,int>>::GrowVector
((CUtlVector<mmodel_t,CUtlMemory<mmodel_t,int>> *)param_1,uVar1);
if (0 < (int)(*(int *)(param_1 + 0xc) - uVar1)) {
/* try { // try from 0019d143 to 0019d147 has its CatchHandler @ 0019d152 */
_V_memmove((void *)((int)*(void **)param_1 + uVar1 * 0x34),*(void **)param_1,
(*(int *)(param_1 + 0xc) - uVar1) * 0x34);
}
iVar4 = 0;
local_158 = 0;
*s_pMap = uVar1;
iVar5 = local_130;
do {
iVar3 = 0;
do {
*(float *)(*(int *)param_1 + iVar4 + iVar3) = *(float *)(iVar5 + iVar3) - 1.0;
*(float *)(iVar3 + 0xc + *(int *)param_1 + iVar4) = *(float *)(iVar5 + 0xc + iVar3) + 1.0;
iVar2 = iVar3 + 4;
*(undefined4 *)(iVar3 + 0x18 + *(int *)param_1 + iVar4) =
*(undefined4 *)(iVar5 + 0x18 + iVar3);
iVar3 = iVar2;
} while (iVar2 != 0xc);
iVar3 = 0;
iVar2 = *(int *)param_1 + iVar4;
do {
fVar6 = ABS(*(float *)(iVar2 + 0xc + iVar3 * 4));
fVar7 = ABS(*(float *)(iVar2 + iVar3 * 4));
if (fVar6 <= fVar7) {
fVar6 = fVar7;
}
local_14c[iVar3] = fVar6;
iVar3 = iVar3 + 1;
} while (iVar3 != 3);
local_158 = local_158 + 1;
*(float *)(iVar2 + 0x24) =
SQRT(local_14c[1] * local_14c[1] + local_14c[0] * local_14c[0] +
local_14c[2] * local_14c[2]);
*(undefined4 *)(*(int *)param_1 + 0x28 + iVar4) = *(undefined4 *)(iVar5 + 0x24);
*(undefined4 *)(*(int *)param_1 + 0x2c + iVar4) = *(undefined4 *)(iVar5 + 0x28);
*(undefined4 *)(*(int *)param_1 + 0x30 + iVar4) = *(undefined4 *)(iVar5 + 0x2c);
iVar4 = iVar4 + 0x34;
iVar5 = iVar5 + 0x30;
} while (uVar1 != local_158);
}
if (local_134 != 0) {
(**(code **)(*g_pFileSystem + 0x150))(g_pFileSystem,local_134);
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.