L L4D2node

CCollisionEvent::FlushQueuedOperations

0x0077b9e0 · 586 bytes · __thiscall

_ZN15CCollisionEvent21FlushQueuedOperationsEv

Decompiled

undefined (1 param)

/* CCollisionEvent::FlushQueuedOperations() */

void __thiscall CCollisionEvent::FlushQueuedOperations(CCollisionEvent *this)

{
  int *piVar1;
  undefined4 *puVar2;
  int iVar3;
  char cVar4;
  undefined4 *puVar5;
  undefined4 *puVar6;
  int iVar7;
  int local_34;
  
  local_34 = 0x14;
  do {
    if (*(int *)(this + 200) + *(int *)(this + 0xf0) + *(int *)(this + 0x104) +
        *(int *)(this + 0x154) + DAT_00fec4f0 == 0) {
      return;
    }
    Warning("Physics queue not empty, error!\n");
    UpdateTouchEvents(this);
    UpdateDamageEvents(this);
    if (DAT_00fec4f0 != 0) {
      do {
        puVar5 = DAT_00fec4f8;
        if (DAT_00fec4f8 == (undefined4 *)0x0) {
          puVar5 = ::operator_new(8);
          break;
        }
        cVar4 = ThreadInterlockedAssignIf64
                          (&DAT_00fec4f8,*DAT_00fec4f8,DAT_00fec4fc + -1,DAT_00fec4f8,DAT_00fec4fc);
      } while (cVar4 == '\0');
      puVar5[1] = 0;
      *puVar5 = &g_PostSimulationQueue;
      while( true ) {
        iVar3 = DAT_00fec4ec;
        puVar2 = DAT_00fec4e8;
        LOCK();
        puVar6 = (undefined4 *)*DAT_00fec4e8;
        if ((undefined4 **)puVar6 == &g_PostSimulationQueue) {
          *DAT_00fec4e8 = puVar5;
          puVar6 = &g_PostSimulationQueue;
        }
        UNLOCK();
        if ((undefined4 **)puVar6 == &g_PostSimulationQueue) break;
        ThreadInterlockedAssignIf64(&DAT_00fec4e8,*puVar2,iVar3 + 1,puVar2,iVar3);
      }
      ThreadInterlockedAssignIf64(&DAT_00fec4e8,puVar5,iVar3 + 1,puVar2,iVar3);
      LOCK();
      DAT_00fec4f0 = DAT_00fec4f0 + 1;
      UNLOCK();
      while( true ) {
        do {
          do {
            while( true ) {
              do {
                puVar6 = g_PostSimulationQueue;
                puVar5 = (undefined4 *)*g_PostSimulationQueue;
              } while (puVar5 == (undefined4 *)0x0);
              if (g_PostSimulationQueue != DAT_00fec4e8) break;
              if ((undefined4 **)puVar5 == &g_PostSimulationQueue) goto LAB_0077b9f2;
              ThreadInterlockedAssignIf64
                        (&DAT_00fec4e8,puVar5,DAT_00fec4ec + 1,g_PostSimulationQueue,DAT_00fec4ec);
            }
          } while ((undefined4 **)puVar5 == &g_PostSimulationQueue);
          piVar1 = (int *)puVar5[1];
          cVar4 = ThreadInterlockedAssignIf64
                            (&g_PostSimulationQueue,puVar5,DAT_00fec4e4 + 1,g_PostSimulationQueue,
                             DAT_00fec4e4);
        } while (cVar4 == '\0');
        LOCK();
        DAT_00fec4f0 = DAT_00fec4f0 + -1;
        UNLOCK();
        puVar6[1] = piVar1;
        do {
          iVar3 = DAT_00fec4fc;
          puVar5 = DAT_00fec4f8;
          iVar7 = DAT_00fec4fc + 0x10001;
          *puVar6 = DAT_00fec4f8;
          cVar4 = ThreadInterlockedAssignIf64(&DAT_00fec4f8,puVar6,iVar7,puVar5,iVar3);
        } while (cVar4 == '\0');
        if (piVar1 == (int *)0x0) break;
        (**(code **)(*piVar1 + 0x10))(piVar1);
        (**(code **)(*piVar1 + 4))(piVar1);
      }
    }
LAB_0077b9f2:
    UpdateRemoveObjects(this);
    local_34 = local_34 + -1;
    if (local_34 == 0) {
      return;
    }
  } while( true );
}

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)