L L4D2node

GCSDK::CJobMgr::AddToYieldList

0x00060fa0 · 563 bytes · __thiscall

_ZN5GCSDK7CJobMgr14AddToYieldListERNS_4CJobE

Decompiled

undefined (2 params)

/* GCSDK::CJobMgr::AddToYieldList(GCSDK::CJob&) */

void __thiscall GCSDK::CJobMgr::AddToYieldList(CJobMgr *this,CJob *param_1)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  undefined4 *puVar6;
  void *pvVar7;
  int iVar8;
  int iVar9;
  int local_20;
  
  uVar1 = *(undefined4 *)(param_1 + 0xc);
  uVar2 = *(undefined4 *)(param_1 + 8);
  iVar9 = *(int *)(this + 0x38);
  uVar3 = *(undefined4 *)(this + 0x4c);
  if (iVar9 != -1) {
    iVar5 = iVar9 * 0x14;
    iVar8 = *(int *)(this + 0x24) + iVar5;
    *(undefined4 *)(this + 0x38) = *(undefined4 *)(iVar8 + 0x10);
    goto LAB_00060fdd;
  }
  iVar5 = *(int *)(this + 0x44);
  local_20 = *(int *)(this + 0x28);
  if ((iVar5 < 0) || (local_20 <= iVar5)) {
    iVar9 = 0;
    if (local_20 < 1) goto LAB_0006106d;
  }
  else {
    iVar9 = iVar5 + 1;
    if ((iVar9 < 0) || (local_20 <= iVar9)) {
LAB_0006106d:
      iVar9 = *(int *)(this + 0x2c);
      if (iVar9 < 0) {
        pvVar7 = *(void **)(this + 0x24);
      }
      else {
        iVar8 = local_20 + 1;
        if (iVar9 == 0) {
          iVar9 = 2;
          if (local_20 != 0) {
            iVar9 = local_20;
          }
          while (local_20 = iVar9, local_20 < iVar8) {
            iVar9 = local_20 * 2;
          }
        }
        else {
          for (local_20 = iVar9 * (local_20 / iVar9 + 1); local_20 < iVar8;
              local_20 = (local_20 + iVar8) / 2) {
          }
        }
        *(int *)(this + 0x28) = local_20;
        if (*(void **)(this + 0x24) == (void *)0x0) {
          pvVar7 = malloc(local_20 * 0x14);
          *(void **)(this + 0x24) = pvVar7;
        }
        else {
          pvVar7 = realloc(*(void **)(this + 0x24),local_20 * 0x14);
          local_20 = *(int *)(this + 0x28);
          iVar5 = *(int *)(this + 0x44);
          *(void **)(this + 0x24) = pvVar7;
        }
      }
      *(void **)(this + 0x48) = pvVar7;
      if ((iVar5 < 0) || (local_20 <= iVar5)) {
        iVar9 = 0;
        if (0 < local_20) goto LAB_0006112a;
      }
      else {
        iVar9 = iVar5 + 1;
        if ((-1 < iVar9) && (iVar9 < local_20)) goto LAB_00061148;
      }
      if (9 < CUtlLinkedList<GCSDK::CJobMgr::JobYielding_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobYielding_t,int>,int>>
              ::AllocInternal(bool)::__executeCount) {
        return;
      }
      CUtlLinkedList<GCSDK::CJobMgr::JobYielding_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobYielding_t,int>,int>>
      ::AllocInternal(bool)::__executeCount =
           CUtlLinkedList<GCSDK::CJobMgr::JobYielding_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobYielding_t,int>,int>>
           ::AllocInternal(bool)::__executeCount + 1;
LAB_0006116a:
      Warning();
      return;
    }
LAB_00061148:
    if (iVar9 == -1) {
      if (9 < CUtlLinkedList<GCSDK::CJobMgr::JobYielding_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobYielding_t,int>,int>>
              ::AllocInternal(bool)::__executeCount) {
        return;
      }
      CUtlLinkedList<GCSDK::CJobMgr::JobYielding_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobYielding_t,int>,int>>
      ::AllocInternal(bool)::__executeCount =
           CUtlLinkedList<GCSDK::CJobMgr::JobYielding_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobYielding_t,int>,int>>
           ::AllocInternal(bool)::__executeCount + 1;
      goto LAB_0006116a;
    }
  }
LAB_0006112a:
  *(int *)(this + 0x44) = iVar9;
  *(int *)(this + 0x40) = *(int *)(this + 0x40) + 1;
  iVar5 = iVar9 * 0x14;
  iVar8 = *(int *)(this + 0x24) + iVar5;
LAB_00060fdd:
  *(int *)(iVar8 + 0x10) = iVar9;
  *(int *)(*(int *)(this + 0x24) + 0xc + iVar5) = iVar9;
  CUtlLinkedList<GCSDK::CJobMgr::JobYielding_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobYielding_t,int>,int>>
  ::Unlink((CUtlLinkedList<GCSDK::CJobMgr::JobYielding_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobYielding_t,int>,int>>
            *)(this + 0x24),iVar9);
  iVar8 = *(int *)(this + 0x24);
  *(undefined4 *)(iVar8 + iVar5 + 0x10) = 0xffffffff;
  iVar4 = *(int *)(this + 0x34);
  *(int *)(iVar8 + iVar5 + 0xc) = iVar4;
  *(int *)(this + 0x34) = iVar9;
  if (iVar4 == -1) {
    *(int *)(this + 0x30) = iVar9;
  }
  else {
    *(int *)(*(int *)(this + 0x24) + iVar4 * 0x14 + 0x10) = iVar9;
  }
  *(int *)(this + 0x3c) = *(int *)(this + 0x3c) + 1;
  puVar6 = (undefined4 *)(iVar5 + *(int *)(this + 0x24));
  if (puVar6 != (undefined4 *)0x0) {
    *puVar6 = uVar2;
    puVar6[1] = uVar1;
    puVar6[2] = uVar3;
  }
  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)