CollisionBSPData_Destroy
0x00123f60 · 1191 bytes · __cdecl
_Z24CollisionBSPData_DestroyP17CCollisionBSPData
Decompiled
undefined (1 param)
/* CollisionBSPData_Destroy(CCollisionBSPData*) */
void CollisionBSPData_Destroy(CCollisionBSPData *param_1)
{
code *pcVar1;
int iVar2;
int iVar3;
uint uVar4;
int iVar5;
iVar5 = 0;
if (0 < *(int *)(param_1 + 0xb4)) {
iVar3 = 0;
do {
pcVar1 = *(code **)(*physcollision + 0x98);
if (*(int *)(param_1 + 0xbc) <= iVar3) {
Error("Cannot load corrupted map.\n");
}
iVar3 = iVar3 + 1;
iVar2 = *(int *)(param_1 + 0xb8) + iVar5;
iVar5 = iVar5 + 0x38;
(*pcVar1)(physcollision,iVar2 + 0x28);
} while (iVar3 < *(int *)(param_1 + 0xb4));
}
if (*(int *)(param_1 + 0x270) != 0) {
uVar4 = 0;
do {
iVar5 = uVar4 * 4;
uVar4 = uVar4 + 1;
(**(code **)(*g_pPhysics2ResourceManager + 0x24))
(g_pPhysics2ResourceManager,*(undefined4 *)(*(int *)(param_1 + 0x27c) + iVar5),0);
} while (uVar4 < *(uint *)(param_1 + 0x270));
}
*(undefined4 *)(param_1 + 0x27c) = 0;
if (*(int *)(param_1 + 0x274) != 0) {
*(undefined4 *)(param_1 + 0x274) = 0;
*(undefined4 *)(param_1 + 0x278) = 0;
}
*(undefined4 *)(param_1 + 0x270) = 0;
DispCollTrees_FreeLeafList(param_1);
CM_DestroyDispPhysCollide();
DispCollTrees_Free(g_pDispCollTrees);
g_pDispCollTrees = (CDispCollTree *)0x0;
g_pDispBounds = 0;
g_DispCollTreeCount = 0;
if (*(int *)(param_1 + 0x80) != 0) {
*(undefined4 *)(param_1 + 0x80) = 0;
*(undefined4 *)(param_1 + 0x84) = 0;
}
if (*(int *)(param_1 + 0x248) != 0) {
*(undefined4 *)(param_1 + 0x248) = 0;
}
if (*(int *)(param_1 + 0x24c) != 0) {
*(undefined4 *)(param_1 + 0x24c) = 0;
*(undefined4 *)(param_1 + 0x250) = 0;
}
if (*(int *)(param_1 + 0x234) != 0) {
*(undefined4 *)(param_1 + 0x234) = 0;
*(undefined4 *)(param_1 + 0x238) = 0;
}
if (*(int *)(param_1 + 0x25c) != 0) {
*(undefined4 *)(param_1 + 0x25c) = 0;
*(undefined4 *)(param_1 + 0x260) = 0;
}
if (*(int *)(param_1 + 0x228) != 0) {
*(undefined4 *)(param_1 + 0x228) = 0;
*(undefined4 *)(param_1 + 0x22c) = 0;
}
*(undefined4 *)(param_1 + 0xf4) = 0;
*(undefined4 *)(param_1 + 0xf8) = 0;
*(undefined4 *)(param_1 + 0x108) = 0;
*(undefined4 *)(param_1 + 0x104) = 0;
param_1[0xfc] = (CCollisionBSPData)0x0;
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)(param_1 + 0xe8));
if (*(int *)(param_1 + 0xc4) != 0) {
*(undefined4 *)(param_1 + 0xc4) = 0;
*(undefined4 *)(param_1 + 200) = 0;
}
if (*(int *)(param_1 + 0xd0) != 0) {
*(undefined4 *)(param_1 + 0xd0) = 0;
*(undefined4 *)(param_1 + 0xd4) = 0;
}
if (*(int *)(param_1 + 0xb8) != 0) {
*(undefined4 *)(param_1 + 0xb8) = 0;
*(undefined4 *)(param_1 + 0xbc) = 0;
}
if (*(int *)(param_1 + 0xac) != 0) {
*(undefined4 *)(param_1 + 0xac) = 0;
*(undefined4 *)(param_1 + 0xb0) = 0;
}
if (*(int *)(param_1 + 0x98) != 0) {
*(undefined4 *)(param_1 + 0x98) = 0;
*(undefined4 *)(param_1 + 0x9c) = 0;
}
if (*(int *)(param_1 + 0x8c) != 0) {
*(undefined4 *)(param_1 + 0x8c) = 0;
*(undefined4 *)(param_1 + 0x90) = 0;
}
if (*(int *)(param_1 + 0x68) != 0) {
*(undefined4 *)(param_1 + 0x68) = 0;
*(undefined4 *)(param_1 + 0x6c) = 0;
}
if (*(int *)(param_1 + 0x74) != 0) {
*(undefined4 *)(param_1 + 0x74) = 0;
*(undefined4 *)(param_1 + 0x78) = 0;
}
if (*(int *)(param_1 + 0x280) != 0) {
*(undefined4 *)(param_1 + 0x280) = 0;
*(undefined4 *)(param_1 + 0x284) = 0;
}
if (*(int *)(param_1 + 0x288) != 0) {
*(undefined4 *)(param_1 + 0x288) = 0;
*(undefined4 *)(param_1 + 0x28c) = 0;
}
if (*(int *)(param_1 + 0x290) != 0) {
*(undefined4 *)(param_1 + 0x290) = 0;
*(undefined4 *)(param_1 + 0x294) = 0;
}
if (*(int *)(param_1 + 0x298) != 0) {
*(undefined4 *)(param_1 + 0x298) = 0;
*(undefined4 *)(param_1 + 0x29c) = 0;
}
if (*(int *)(param_1 + 0x2a0) != 0) {
*(undefined4 *)(param_1 + 0x2a0) = 0;
*(undefined4 *)(param_1 + 0x2a4) = 0;
}
if (*(int *)(param_1 + 0xdc) != 0) {
*(undefined4 *)(param_1 + 0xdc) = 0;
}
iVar5 = *(int *)(param_1 + 0x268);
*(undefined4 *)(param_1 + 0x7c) = 0;
*(undefined4 *)(param_1 + 100) = 0;
*(undefined4 *)(param_1 + 0xa4) = 0;
*(undefined4 *)(param_1 + 0xa0) = 0;
param_1[4] = (CCollisionBSPData)0x0;
*(undefined4 *)(param_1 + 0x88) = 0;
*(undefined4 *)(param_1 + 0x94) = 0;
*(undefined4 *)(param_1 + 0xc0) = 0;
*(undefined4 *)(param_1 + 0x70) = 0;
*(undefined4 *)(param_1 + 0xcc) = 0;
*(undefined4 *)(param_1 + 0xa8) = 0;
*(undefined4 *)(param_1 + 0x224) = 0;
*(undefined4 *)(param_1 + 0x244) = 0;
*(undefined4 *)(param_1 + 0x254) = 0;
*(undefined4 *)(param_1 + 0x230) = 0;
*(undefined4 *)(param_1 + 0x23c) = 0;
*(undefined4 *)(param_1 + 0xb4) = 0;
*(undefined4 *)(param_1 + 0xd8) = 0;
*(undefined4 *)(param_1 + 0xe0) = 0;
*(undefined4 *)(param_1 + 600) = 0;
*(undefined4 *)param_1 = 0;
if (iVar5 != 0) {
if (g_pPhysics2Collision != (int *)0x0) {
(**(code **)(*g_pPhysics2Collision + 4))(g_pPhysics2Collision,iVar5);
}
if (g_pPhysics2ResourceManager != (int *)0x0) {
(**(code **)(*g_pPhysics2ResourceManager + 0x2c))(g_pPhysics2ResourceManager,iVar5);
}
*(undefined4 *)(param_1 + 0x268) = 0;
}
if (*(void **)(param_1 + 0x26c) != (void *)0x0) {
free(*(void **)(param_1 + 0x26c));
*(undefined4 *)(param_1 + 0x26c) = 0;
}
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.