L L4D2node

CTeamplayRoundBasedRules::State_Think_STALEMATE

0x004ca6e0 · 860 bytes · __thiscall

_ZN24CTeamplayRoundBasedRules21State_Think_STALEMATEEv

Decompiled

undefined (1 param)

/* CTeamplayRoundBasedRules::State_Think_STALEMATE() */

void __thiscall CTeamplayRoundBasedRules::State_Think_STALEMATE(CTeamplayRoundBasedRules *this)

{
  uint uVar1;
  char cVar2;
  bool bVar3;
  int iVar4;
  int *piVar5;
  int iVar6;
  int *piVar7;
  undefined *puVar8;
  int iVar9;
  longdouble lVar10;
  int local_48;
  int local_44;
  int local_40;
  int local_30 [3];
  undefined4 local_24;
  undefined4 local_20;
  
  iVar4 = (**(code **)(*(int *)this + 0x2f8))(this);
  if ((iVar4 < 1) && (cVar2 = (**(code **)(*(int *)this + 0x29c))(this), cVar2 == '\0')) {
    State_Leave(this);
    State_Enter(this,1);
  }
  else {
    local_40 = 2;
    local_44 = 0;
    local_48 = 0;
    iVar4 = GetNumberOfTeams();
    if (2 < iVar4) {
      do {
        piVar5 = (int *)GetGlobalTeam(local_40);
        iVar4 = (**(code **)(*piVar5 + 0x354))(piVar5);
        if (0 < iVar4) {
          iVar9 = 0;
          do {
            iVar6 = (**(code **)(*piVar5 + 0x358))(piVar5,iVar9);
            if (iVar6 != 0) {
              piVar7 = (int *)(**(code **)(*piVar5 + 0x358))(piVar5,iVar9);
              cVar2 = (**(code **)(*piVar7 + 300))(piVar7);
              if (cVar2 != '\0') {
                local_44 = local_40;
                goto LAB_004ca792;
              }
            }
            iVar9 = iVar9 + 1;
          } while (iVar9 != iVar4);
        }
        local_48 = local_40;
LAB_004ca792:
        local_40 = local_40 + 1;
        iVar4 = GetNumberOfTeams();
      } while (local_40 < iVar4);
    }
    if ((local_44 == 0) || (local_48 == 0)) {
      if ((local_44 == 0) && (local_48 != 0)) {
LAB_004ca85b:
        if (((DAT_00f9ebe8 == 0) || (uVar1 = *g_hControlPointMasters, uVar1 == 0xffffffff)) ||
           ((puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc ||
            (*(uint *)(puVar8 + 8) != uVar1 >> 0xc)))) {
          bVar3 = true;
        }
        else if (*(int *)(puVar8 + 4) == 0) {
          bVar3 = true;
        }
        else {
          bVar3 = *(int *)(*(int *)(puVar8 + 4) + 0x46c) < 1;
        }
        (**(code **)(*(int *)this + 0x268))(this,0,5,bVar3,0,0);
        return;
      }
      uVar1 = *(uint *)(this + 0x25c);
      if (((uVar1 != 0xffffffff) &&
          (((puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc &&
            (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar8 + 4) != 0)))) &&
         (cVar2 = (**(code **)(*(int *)this + 0x264))(this), cVar2 != '\0')) {
        uVar1 = *(uint *)(this + 0x25c);
        piVar5 = (int *)0x0;
        if (((uVar1 != 0xffffffff) &&
            (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
           (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
          piVar5 = *(int **)(puVar8 + 4);
        }
        lVar10 = (longdouble)(**(code **)(*piVar5 + 0x324))(piVar5);
        if ((float)lVar10 <= 0.0) goto LAB_004ca85b;
      }
    }
    else {
      if ((this[0x268] == (CTeamplayRoundBasedRules)0x0) &&
         ((((DAT_00f9ebe8 != 0 && (uVar1 = *g_hControlPointMasters, uVar1 != 0xffffffff)) &&
           (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
          ((*(uint *)(puVar8 + 8) == uVar1 >> 0xc &&
           (piVar5 = *(int **)(puVar8 + 4), piVar5 != (int *)0x0)))))) {
        local_24 = 0xffffffff;
        local_20 = 5;
        local_30[0] = local_44;
        (**(code **)(*piVar5 + 0xb4))(piVar5,"SetWinnerAndForceCaps",0,0,local_30,0);
        return;
      }
      (**(code **)(*(int *)this + 0x268))(this,local_44,2,this[0x268],0,0);
    }
  }
  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)