L L4D2node

CTeamplayRoundBasedRules::SetWinningTeam

0x004cc4c0 · 730 bytes · __thiscall

_ZN24CTeamplayRoundBasedRules14SetWinningTeamEiibbb

Decompiled

undefined (6 params)

/* CTeamplayRoundBasedRules::SetWinningTeam(int, int, bool, bool, bool) */

void __thiscall
CTeamplayRoundBasedRules::SetWinningTeam
          (CTeamplayRoundBasedRules *this,int param_1,int param_2,bool param_3,bool param_4,
          bool param_5)

{
  bool bVar1;
  char cVar2;
  int *piVar3;
  int iVar4;
  
  cVar2 = IsInCommentaryMode();
  if ((cVar2 == '\0') &&
     (((param_1 == 0 || ((1 < param_1 && (iVar4 = GetNumberOfTeams(), param_1 < iVar4)))) &&
      (*(int *)(this + 0x318) != 5)))) {
    this[0x268] = (CTeamplayRoundBasedRules)param_3;
    (**(code **)(*(int *)this + 0x270))(this,param_4);
    if (param_1 != *(int *)(this + 800)) {
      CGameRulesProxy::NotifyNetworkStateChanged();
      *(int *)(this + 800) = param_1;
    }
    if (param_2 != *(int *)(this + 0x324)) {
      CGameRulesProxy::NotifyNetworkStateChanged();
      *(int *)(this + 0x324) = param_2;
    }
    PlayWinSong(this,param_1);
    bVar1 = true;
    if (!param_3) {
      bVar1 = false;
      if (0 < *(int *)(mp_timelimit._28_4_ + 0x30)) {
        bVar1 = (int)(((float)(*(int *)(mp_timelimit._28_4_ + 0x30) * 0x3c) -
                      *(float *)(gpGlobals + 0xc)) + *(float *)(this + 0x330)) < 1;
      }
    }
    this[0x314] = (CTeamplayRoundBasedRules)0x0;
    if ((((!param_5) && (bVar1)) && (param_1 != 0)) &&
       (cVar2 = (**(code **)(*(int *)this + 0x2cc))(this), cVar2 != '\0')) {
      piVar3 = (int *)GetGlobalTeam(param_1);
      (**(code **)(*piVar3 + 0x35c))(piVar3,1);
      this[0x314] = (CTeamplayRoundBasedRules)0x1;
    }
    bVar1 = false;
    if (*(int *)(this + 0x318) == 7) {
      bVar1 = 1 < *(int *)(this + 800);
    }
    State_Leave(this);
    State_Enter(this,5);
    piVar3 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                              (gameeventmanager,"teamplay_round_win",0,0);
    if (piVar3 != (int *)0x0) {
      (**(code **)(*piVar3 + 0x30))(piVar3,"team",param_1);
      (**(code **)(*piVar3 + 0x2c))(piVar3,"full_round",param_3);
      (**(code **)(*piVar3 + 0x38))
                (piVar3,"round_time",*(float *)(gpGlobals + 0xc) - *(float *)(this + 0x30c));
      (**(code **)(*piVar3 + 0x2c))(piVar3,"was_sudden_death",bVar1);
      (**(code **)(*(int *)this + 0x2e0))(this,piVar3);
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar3,0);
    }
    (**(code **)(*(int *)this + 0x2b4))(this);
    if ((param_1 == 0) && (0 < *(int *)(gpGlobals + 0x14))) {
      iVar4 = 1;
      do {
        piVar3 = (int *)UTIL_PlayerByIndex(iVar4);
        if ((piVar3 != (int *)0x0) &&
           (cVar2 = (**(code **)(*piVar3 + 0x16c))(piVar3), cVar2 != '\0')) {
          (**(code **)(*piVar3 + 0x7b8))(piVar3,0x2c,0,0,0,0);
        }
        iVar4 = iVar4 + 1;
      } while (iVar4 <= *(int *)(gpGlobals + 0x14));
    }
  }
  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)