L L4D2node

Mod_LoadLighting

0x00196050 · 183 bytes · __cdecl

_Z16Mod_LoadLightingR14CMapLoadHelper

Decompiled

undefined (1 param)

/* Mod_LoadLighting(CMapLoadHelper&) */

void Mod_LoadLighting(CMapLoadHelper *param_1)

{
  size_t __size;
  int iVar1;
  void *pvVar2;
  int iVar3;
  undefined4 uVar4;
  
  iVar1 = s_pMap;
  __size = *(size_t *)param_1;
  if (__size == 0) {
    *(undefined4 *)(s_pMap + 0x94) = 0;
  }
  else {
    if ((*(int *)(r_unloadlightmaps._28_4_ + 0x30) == 0) &&
       (*(int *)(r_hunkalloclightmaps._28_4_ + 0x30) != 0)) {
      g_bHunkAllocLightmaps = 1;
      uVar4 = Hunk_AllocName(__size,"lightdata",false);
      *(undefined4 *)(iVar1 + 0x94) = uVar4;
      iVar3 = s_pMap;
    }
    else {
      g_bHunkAllocLightmaps = 0;
      pvVar2 = malloc(__size);
      *(void **)(iVar1 + 0x94) = pvVar2;
      iVar3 = iVar1;
    }
    *(undefined1 *)(iVar1 + 0xec) = 0;
    if (*(void **)(iVar3 + 0x94) != (void *)0x0) {
      memcpy(*(void **)(iVar3 + 0x94),*(void **)(param_1 + 0x10),*(size_t *)param_1);
      return;
    }
  }
  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)