L L4D2node

CSpatialPartition::HideElement

0x001dc180 · 122 bytes · __thiscall

_ZN17CSpatialPartition11HideElementEt

Decompiled

undefined (2 params)

/* CSpatialPartition::HideElement(unsigned short) */

undefined4 __thiscall CSpatialPartition::HideElement(CSpatialPartition *this,ushort param_1)

{
  CSpatialPartition *pCVar1;
  byte *pbVar2;
  uint uVar3;
  uint uVar4;
  
  uVar4 = ThreadGetCurrentId();
  pCVar1 = this + 0x34;
  if (uVar4 != *(uint *)(this + 0x34)) {
    LOCK();
    uVar3 = *(uint *)pCVar1;
    if (uVar3 == 0) {
      *(uint *)pCVar1 = uVar4;
    }
    UNLOCK();
    if (uVar3 != 0) {
      CThreadFastMutex::Lock((uint)pCVar1,uVar4);
      goto LAB_001dc1b1;
    }
  }
  *(int *)(this + 0x38) = *(int *)(this + 0x38) + 1;
LAB_001dc1b1:
  pbVar2 = (byte *)((uint)param_1 * 0x34 + *(int *)(this + 0x10) + 0x1e);
  *pbVar2 = *pbVar2 | 1;
  *(int *)(this + 0x38) = *(int *)(this + 0x38) + -1;
  if (*(int *)(this + 0x38) == 0) {
    LOCK();
    *(uint *)pCVar1 = 0;
    UNLOCK();
  }
  return 1;
}

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)