L L4D2node

CSpatialPartition::UnhideElement

0x001dc200 · 117 bytes · __cdecl

_ZN17CSpatialPartition13UnhideElementEti

Decompiled

undefined (2 params)

/* CSpatialPartition::UnhideElement(unsigned short, int) */

uint CSpatialPartition::UnhideElement(ushort param_1,int param_2)

{
  uint *puVar1;
  byte *pbVar2;
  uint uVar3;
  uint uVar4;
  undefined2 in_stack_00000006;
  
  uVar4 = ThreadGetCurrentId();
  puVar1 = (uint *)(_param_1 + 0x34);
  if (uVar4 != *(uint *)(_param_1 + 0x34)) {
    LOCK();
    uVar3 = *puVar1;
    if (uVar3 == 0) {
      *puVar1 = uVar4;
    }
    UNLOCK();
    if (uVar3 != 0) {
      CThreadFastMutex::Lock((uint)puVar1,uVar4);
      goto LAB_001dc231;
    }
  }
  *(int *)(_param_1 + 0x38) = *(int *)(_param_1 + 0x38) + 1;
LAB_001dc231:
  pbVar2 = (byte *)((param_2 & 0xffffU) * 0x34 + *(int *)(_param_1 + 0x10) + 0x1e);
  *pbVar2 = *pbVar2 & 0xfe;
  *(int *)(_param_1 + 0x38) = *(int *)(_param_1 + 0x38) + -1;
  uVar4 = *(uint *)(_param_1 + 0x38);
  if (uVar4 == 0) {
    LOCK();
    uVar4 = *puVar1;
    *puVar1 = 0;
    UNLOCK();
  }
  return uVar4;
}

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)