L L4D2node

Mod_LoadLeafWaterData

0x00198a30 · 463 bytes · unknown

_Z21Mod_LoadLeafWaterDatav

Decompiled

undefined (0 params)

/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* Mod_LoadLeafWaterData() */

void Mod_LoadLeafWaterData(void)

{
  short *psVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined2 uVar4;
  undefined1 *puVar5;
  char *pcVar6;
  undefined4 *puVar7;
  int iVar8;
  int iVar9;
  uint uVar10;
  int in_GS_OFFSET;
  uint local_140 [3];
  int local_134;
  undefined4 *local_130;
  int local_128;
  undefined1 local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  CMapLoadHelper::CMapLoadHelper((CMapLoadHelper *)local_140,0x24);
  if (local_140[0] != (local_140[0] / 0xc) * 0xc) {
                    /* try { // try from 00198baf to 00198bb3 has its CatchHandler @ 00198c0a */
    Host_Error("Mod_LoadLeafs: funny lump size in %s",s_szMapPathName);
  }
  uVar3 = local_140[0] / 0xc;
  puVar5 = s_szMapPathName;
  if ((&s_MapLumpFiles)[local_128 * 7] != 0) {
    puVar5 = local_124;
  }
                    /* try { // try from 00198ad0 to 00198b2f has its CatchHandler @ 00198c0a */
  pcVar6 = (char *)va("%s [%s]",puVar5,"leafwaterdata");
  puVar7 = (undefined4 *)Hunk_AllocName(uVar3 * 0xc,pcVar6,true);
  iVar9 = s_pMap;
  *(uint *)(s_pMap + 0x14) = uVar3;
  uVar10 = 0;
  *(undefined4 **)(iVar9 + 0x18) = puVar7;
  if (uVar3 != 0) {
    do {
      puVar7[1] = local_130[1];
      uVar4 = CMapLoadHelper::BoundsCheck_surfaceTexInfoID
                        ((CMapLoadHelper *)local_140,(int)*(short *)(local_130 + 2));
      *(undefined2 *)(puVar7 + 2) = uVar4;
      uVar10 = uVar10 + 1;
      uVar2 = *local_130;
      *(undefined2 *)((int)puVar7 + 10) = 0xffff;
      *puVar7 = uVar2;
      puVar7 = puVar7 + 3;
      local_130 = local_130 + 3;
    } while (uVar3 != uVar10);
    if ((uVar3 == 1) && (0 < *(int *)(s_pMap + 0xc))) {
      iVar9 = *(int *)(s_pMap + 0x10);
      iVar8 = 0;
      if (*(short *)(iVar9 + 0x32) < 0) {
        do {
          iVar8 = iVar8 + 1;
          if (iVar8 == *(int *)(s_pMap + 0xc)) goto LAB_00198b60;
          psVar1 = (short *)(iVar9 + 0x72);
          iVar9 = iVar9 + 0x40;
        } while (*psVar1 < 0);
      }
      else {
        iVar8 = 0;
      }
      *(short *)(*(int *)(s_pMap + 0x18) + 10) = (short)iVar8;
    }
  }
LAB_00198b60:
  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 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)