L L4D2node

CollisionBSPData_LoadPhysics

0x00122b40 · 408 bytes · __cdecl

_Z28CollisionBSPData_LoadPhysicsP17CCollisionBSPData

Decompiled

undefined (1 param)

/* CollisionBSPData_LoadPhysics(CCollisionBSPData*) */

void CollisionBSPData_LoadPhysics(CCollisionBSPData *param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int *piVar5;
  int *piVar6;
  int *piVar7;
  int in_GS_OFFSET;
  CMapLoadHelper local_140 [288];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  CMapLoadHelper::CMapLoadHelper(local_140,0x1d);
                    /* try { // try from 00122b7f to 00122cda has its CatchHandler @ 00122ce2 */
  iVar4 = CMapLoadHelper::LumpSize(local_140);
  if (iVar4 == 0) {
    CMapLoadHelper::~CMapLoadHelper(local_140);
  }
  else {
    piVar5 = (int *)CMapLoadHelper::LumpBase(local_140);
    piVar6 = piVar5;
    do {
      iVar4 = piVar6[2];
      piVar7 = piVar6 + 4;
      iVar1 = piVar6[1];
      iVar2 = *piVar6;
      iVar3 = piVar6[3];
      if (0 < iVar1) {
        if ((iVar2 < 0) || (*(int *)(param_1 + 0xbc) <= iVar2)) {
          Error("Cannot load corrupted map.\n");
        }
        (**(code **)(*physcollision + 0x94))
                  (physcollision,iVar2 * 0x38 + *(int *)(param_1 + 0xb8) + 0x28,iVar3,piVar7,
                   iVar4 + iVar1,0);
        piVar7 = (int *)((int)piVar7 + iVar4 + iVar1);
      }
      iVar4 = CMapLoadHelper::LumpSize(local_140);
    } while (((int)piVar7 - (int)piVar5 <= iVar4) && (piVar6 = piVar7, 0 < iVar1));
    if (*(int *)(param_1 + 0xbc) < 1) {
      Error("Cannot load corrupted map.\n");
    }
    if ((*(ushort *)(*(int *)(param_1 + 0xb8) + 0x28) & 0x7fff) == 0) {
      Sys_Error("No physics for world in map %s",param_1 + 4);
    }
    CMapLoadHelper::~CMapLoadHelper(local_140);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)