CollisionBSPData_LoadPropCollision
0x00123100 · 1136 bytes · __cdecl
_Z34CollisionBSPData_LoadPropCollisionP17CCollisionBSPData
Decompiled
undefined (1 param)
/* CollisionBSPData_LoadPropCollision(CCollisionBSPData*) */
void CollisionBSPData_LoadPropCollision(CCollisionBSPData *param_1)
{
int iVar1;
int iVar2;
int iVar3;
uint uVar4;
undefined4 uVar5;
void *pvVar6;
undefined4 uVar7;
undefined4 *puVar8;
int iVar9;
uint uVar10;
int in_GS_OFFSET;
CMapLoadHelper local_380 [288];
CMapLoadHelper local_260 [288];
CMapLoadHelper local_140 [288];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (g_pPhysics2 != 0) {
CMapLoadHelper::CMapLoadHelper(local_380,0x16);
/* try { // try from 00123146 to 001231e1 has its CatchHandler @ 001235c0 */
iVar3 = CMapLoadHelper::LumpSize(local_380);
if (iVar3 == 0) {
/* try { // try from 0012355f to 00123563 has its CatchHandler @ 001235c0 */
Warning("No static prop hulls in map, need to rebuild!\n");
CMapLoadHelper::~CMapLoadHelper(local_380);
}
else {
uVar4 = CMapLoadHelper::LumpSize(local_380);
iVar3 = CMapLoadHelper::LumpSize(local_380);
uVar5 = Hunk_AllocName(iVar3,"PropCollisionModels",false);
*(undefined4 *)(param_1 + 0x2a0) = uVar5;
*(uint *)(param_1 + 0x2a4) = uVar4 >> 3;
iVar3 = CMapLoadHelper::LumpSize(local_380);
pvVar6 = (void *)CMapLoadHelper::LumpBase(local_380);
_V_memcpy(*(void **)(param_1 + 0x2a0),pvVar6,iVar3);
CMapLoadHelper::CMapLoadHelper(local_140,0x18);
/* try { // try from 001231eb to 00123261 has its CatchHandler @ 00123574 */
iVar3 = CMapLoadHelper::LumpSize(local_140);
uVar5 = Hunk_AllocName(iVar3,"PropCollisionVerts",false);
uVar4 = CMapLoadHelper::LumpSize(local_140);
*(undefined4 *)(param_1 + 0x288) = uVar5;
*(uint *)(param_1 + 0x28c) = uVar4 / 0xc;
iVar3 = CMapLoadHelper::LumpSize(local_140);
pvVar6 = (void *)CMapLoadHelper::LumpBase(local_140);
_V_memcpy(*(void **)(param_1 + 0x288),pvVar6,iVar3);
CMapLoadHelper::~CMapLoadHelper(local_140);
/* try { // try from 00123281 to 00123285 has its CatchHandler @ 001235c0 */
CMapLoadHelper::CMapLoadHelper(local_140,0x31);
/* try { // try from 0012328f to 00123309 has its CatchHandler @ 0012359a */
CMapLoadHelper::LumpSize(local_140);
iVar3 = CMapLoadHelper::LumpSize(local_140);
uVar5 = Hunk_AllocName(iVar3,"PropBlobData",false);
uVar7 = CMapLoadHelper::LumpSize(local_140);
*(undefined4 *)(param_1 + 0x29c) = uVar7;
*(undefined4 *)(param_1 + 0x298) = uVar5;
iVar3 = CMapLoadHelper::LumpSize(local_140);
pvVar6 = (void *)CMapLoadHelper::LumpBase(local_140);
_V_memcpy(*(void **)(param_1 + 0x298),pvVar6,iVar3);
CMapLoadHelper::~CMapLoadHelper(local_140);
/* try { // try from 00123329 to 0012332d has its CatchHandler @ 001235c0 */
CMapLoadHelper::CMapLoadHelper(local_260,0x17);
/* try { // try from 00123337 to 0012349a has its CatchHandler @ 0012359c */
uVar4 = CMapLoadHelper::LumpSize(local_260);
uVar4 = uVar4 >> 4;
puVar8 = (undefined4 *)CMapLoadHelper::LumpBase(local_260);
iVar3 = Hunk_AllocName(uVar4 << 4,"PropCollisionHulls",false);
*(int *)(param_1 + 0x280) = iVar3;
*(uint *)(param_1 + 0x284) = uVar4;
if (uVar4 != 0) {
uVar10 = 0;
while( true ) {
iVar9 = uVar10 * 0x10;
*(undefined4 *)(iVar3 + 0xc + iVar9) = puVar8[3];
iVar3 = *(int *)(param_1 + 0x298);
iVar1 = puVar8[2];
if (*(int *)(param_1 + 0x284) <= (int)uVar10) {
Error("Cannot load corrupted map.\n");
}
iVar2 = *(int *)(param_1 + 0x280);
uVar5 = (**(code **)(*physprops + 0x10))(physprops,iVar3 + iVar1);
*(undefined4 *)(iVar9 + iVar2 + 8) = uVar5;
if (*(int *)(param_1 + 0x284) <= (int)uVar10) {
Error("Cannot load corrupted map.\n");
}
*(undefined4 *)(*(int *)(param_1 + 0x280) + iVar9) = *puVar8;
if (*(int *)(param_1 + 0x284) <= (int)uVar10) {
Error("Cannot load corrupted map.\n");
}
uVar10 = uVar10 + 1;
*(undefined4 *)(*(int *)(param_1 + 0x280) + 4 + iVar9) = puVar8[1];
if (uVar4 == uVar10) break;
if (*(int *)(param_1 + 0x284) <= (int)uVar10) {
Error("Cannot load corrupted map.\n");
}
iVar3 = *(int *)(param_1 + 0x280);
puVar8 = puVar8 + 4;
}
}
CMapLoadHelper::CMapLoadHelper(local_140,0x19);
/* try { // try from 001234a4 to 00123513 has its CatchHandler @ 001235ae */
uVar4 = CMapLoadHelper::LumpSize(local_140);
iVar3 = CMapLoadHelper::LumpSize(local_140);
uVar5 = Hunk_AllocName(iVar3,"PropHullTris",false);
*(undefined4 *)(param_1 + 0x290) = uVar5;
*(uint *)(param_1 + 0x294) = uVar4 >> 3;
iVar3 = CMapLoadHelper::LumpSize(local_140);
pvVar6 = (void *)CMapLoadHelper::LumpBase(local_140);
_V_memcpy(*(void **)(param_1 + 0x290),pvVar6,iVar3);
CMapLoadHelper::~CMapLoadHelper(local_140);
CMapLoadHelper::~CMapLoadHelper(local_260);
CMapLoadHelper::~CMapLoadHelper(local_380);
}
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__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.