DispInfo_ReleaseMaterialSystemObjects
0x0013a830 · 626 bytes · __cdecl
_Z37DispInfo_ReleaseMaterialSystemObjectsP7model_t
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* DispInfo_ReleaseMaterialSystemObjects(model_t*) */
void DispInfo_ReleaseMaterialSystemObjects(model_t *param_1)
{
void *pvVar1;
int *piVar2;
void *pvVar3;
int iVar4;
int iVar5;
int local_34;
piVar2 = (int *)(**(code **)(*materials + 0x180))(materials);
if (piVar2 != (int *)0x0) {
/* try { // try from 0013a855 to 0013a857 has its CatchHandler @ 0013aab7 */
(**(code **)(*piVar2 + 8))(piVar2);
}
local_34 = 0;
pvVar3 = g_DispGroups;
if (0 < DAT_0039eb58) {
do {
iVar5 = *(int *)((int)g_DispGroups + local_34 * 4);
if (0 < *(int *)(iVar5 + 0x14)) {
iVar4 = 0;
do {
/* try { // try from 0013a8a4 to 0013aa46 has its CatchHandler @ 0013aaa2 */
(**(code **)(*piVar2 + 0xe4))(piVar2,**(undefined4 **)(*(int *)(iVar5 + 8) + iVar4 * 4));
iVar4 = iVar4 + 1;
} while (iVar4 < *(int *)(iVar5 + 0x14));
iVar4 = 0;
if (0 < *(int *)(iVar5 + 0x14)) {
do {
pvVar3 = *(void **)(*(int *)(iVar5 + 8) + iVar4 * 4);
if (pvVar3 != (void *)0x0) {
*(undefined4 *)((int)pvVar3 + 0x38) = 0;
CUtlMemory<CPrimList,int>::Purge((CUtlMemory<CPrimList,int> *)((int)pvVar3 + 0x2c));
*(undefined4 *)((int)pvVar3 + 0x3c) = *(undefined4 *)((int)pvVar3 + 0x2c);
CUtlMemory<CPrimList,int>::Purge((CUtlMemory<CPrimList,int> *)((int)pvVar3 + 0x2c));
*(undefined4 *)((int)pvVar3 + 0x24) = 0;
CUtlMemory<CDispInfo*,int>::Purge((CUtlMemory<CDispInfo*,int> *)((int)pvVar3 + 0x18));
*(undefined4 *)((int)pvVar3 + 0x28) = *(undefined4 *)((int)pvVar3 + 0x18);
CUtlMemory<CDispInfo*,int>::Purge((CUtlMemory<CDispInfo*,int> *)((int)pvVar3 + 0x18));
*(undefined4 *)((int)pvVar3 + 0x10) = 0;
CUtlMemory<CDispInfo*,int>::Purge((CUtlMemory<CDispInfo*,int> *)((int)pvVar3 + 4));
*(undefined4 *)((int)pvVar3 + 0x14) = *(undefined4 *)((int)pvVar3 + 4);
CUtlMemory<CDispInfo*,int>::Purge((CUtlMemory<CDispInfo*,int> *)((int)pvVar3 + 4));
operator_delete(pvVar3);
}
iVar4 = iVar4 + 1;
} while (iVar4 < *(int *)(iVar5 + 0x14));
}
}
*(undefined4 *)(iVar5 + 0x14) = 0;
CUtlMemory<CGroupMesh*,int>::Purge((CUtlMemory<CGroupMesh*,int> *)(iVar5 + 8));
local_34 = local_34 + 1;
*(undefined4 *)(iVar5 + 0x18) = *(undefined4 *)(iVar5 + 8);
} while (local_34 < DAT_0039eb58);
pvVar3 = g_DispGroups;
if (0 < DAT_0039eb58) {
iVar5 = 0;
do {
pvVar1 = *(void **)((int)pvVar3 + iVar5 * 4);
if (pvVar1 != (void *)0x0) {
*(undefined4 *)((int)pvVar1 + 0x28) = 0;
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)((int)pvVar1 + 0x1c));
*(undefined4 *)((int)pvVar1 + 0x2c) = *(undefined4 *)((int)pvVar1 + 0x1c);
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)((int)pvVar1 + 0x1c));
*(undefined4 *)((int)pvVar1 + 0x14) = 0;
CUtlMemory<CGroupMesh*,int>::Purge((CUtlMemory<CGroupMesh*,int> *)((int)pvVar1 + 8));
*(undefined4 *)((int)pvVar1 + 0x18) = *(undefined4 *)((int)pvVar1 + 8);
CUtlMemory<CGroupMesh*,int>::Purge((CUtlMemory<CGroupMesh*,int> *)((int)pvVar1 + 8));
operator_delete(pvVar1);
pvVar3 = g_DispGroups;
}
iVar5 = iVar5 + 1;
} while (iVar5 < DAT_0039eb58);
}
}
DAT_0039eb58 = 0;
if (-1 < DAT_0039eb54) {
if (pvVar3 != (void *)0x0) {
free(pvVar3);
g_DispGroups = (void *)0x0;
}
DAT_0039eb50 = 0;
pvVar3 = (void *)0x0;
}
_DAT_0039eb5c = pvVar3;
if ((param_1 != (model_t *)0x0) && (iVar5 = *(int *)(param_1 + 0x134), 0 < *(int *)(iVar5 + 0x68))
) {
iVar4 = 0;
do {
iVar5 = DispInfo_IndexArray(*(void **)(iVar5 + 0x6c),iVar4);
if (iVar5 != 0) {
*(undefined4 *)(iVar5 + 0x28) = 0;
*(undefined4 *)(iVar5 + 0x24) = 0;
*(undefined4 *)(iVar5 + 0x2c) = 0;
}
iVar4 = iVar4 + 1;
iVar5 = *(int *)(param_1 + 0x134);
} while (iVar4 < *(int *)(iVar5 + 0x68));
}
if ((piVar2 != (int *)0x0) && ((**(code **)(*piVar2 + 0xc))(piVar2), piVar2 != (int *)0x0)) {
(**(code **)(*piVar2 + 4))(piVar2);
}
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.