L L4D2node

GCSDK::CJob::BYieldingAcquireLock

0x0005f900 · 172 bytes · __thiscall

_ZN5GCSDK4CJob20BYieldingAcquireLockEPNS_5CLockE

Decompiled

undefined (2 params)

/* GCSDK::CJob::BYieldingAcquireLock(GCSDK::CLock*) */

bool __thiscall GCSDK::CJob::BYieldingAcquireLock(CJob *this,CLock *param_1)

{
  int iVar1;
  int iVar2;
  bool bVar3;
  
  bVar3 = false;
  if (*(int *)(this + 0x54) == 0) {
    *(int *)(this + 0x1c) = *(int *)(this + 0x1c) + 1;
    if (*(int *)param_1 == 0) {
      *(CJob **)param_1 = this;
      CJobTime::SetToJobTime((CJobTime *)(param_1 + 8));
      *(CLock **)(this + 0x54) = param_1;
      bVar3 = true;
    }
    else {
      iVar2 = *(int *)(param_1 + 4);
      iVar1 = *(int *)param_1;
      if (iVar2 == 0) {
        do {
          iVar2 = iVar1;
          iVar1 = *(int *)(iVar2 + 0x5c);
        } while (iVar1 != 0);
        *(CJob **)(iVar2 + 0x5c) = this;
      }
      else {
        for (iVar1 = *(int *)(iVar2 + 0x5c); iVar1 != 0; iVar1 = *(int *)(iVar1 + 0x5c)) {
          iVar2 = iVar1;
        }
        *(CJob **)(iVar2 + 0x5c) = this;
      }
      *(CJob **)(param_1 + 4) = this;
      *(int *)(this + 0x20) = *(int *)(this + 0x20) + 1;
      *(CLock **)(this + 0x58) = param_1;
      Pause(this,4);
      *(undefined4 *)(this + 0x58) = 0;
      if (*(CLock **)(this + 0x54) != param_1) {
        this[0x18] = (CJob)((byte)this[0x18] | 2);
        return false;
      }
      bVar3 = this == *(CJob **)param_1;
    }
  }
  return bVar3;
}

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)