L L4D2node

CTeamplayRoundBasedRules::WouldChangeUnbalanceTeams

0x004cced0 · 204 bytes · __thiscall

_ZN24CTeamplayRoundBasedRules25WouldChangeUnbalanceTeamsEiii

Decompiled

undefined (4 params)

/* CTeamplayRoundBasedRules::WouldChangeUnbalanceTeams(int, int, int) */

undefined4 __thiscall
CTeamplayRoundBasedRules::WouldChangeUnbalanceTeams
          (CTeamplayRoundBasedRules *this,int param_1,int param_2,int param_3)

{
  int *piVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  int iVar5;
  
  if ((((param_2 != param_3) && (*(int *)(mp_tournament._28_4_ + 0x30) == 0)) &&
      (0 < *(int *)(mp_teams_unbalance_limit._28_4_ + 0x30))) && (1 < param_2)) {
    piVar1 = (int *)GetGlobalTeam(param_2);
    if (piVar1 == (int *)0x0) {
      return 1;
    }
    iVar2 = (**(code **)(*piVar1 + 0x354))(piVar1);
    piVar3 = (int *)GetGlobalTeam(2);
    if (piVar3 != (int *)0x0) {
      iVar5 = 2;
      do {
        if (piVar3 != piVar1) {
          iVar4 = (**(code **)(*piVar3 + 0x354))(piVar3);
          if ((iVar5 == param_3) && (iVar4 = iVar4 - param_1, iVar4 < 0)) {
            iVar4 = 0;
          }
          if (*(int *)(mp_teams_unbalance_limit._28_4_ + 0x30) + param_1 <=
              (iVar2 + param_1) - iVar4) {
            return 1;
          }
        }
        iVar5 = iVar5 + 1;
        piVar3 = (int *)GetGlobalTeam(iVar5);
      } while (piVar3 != (int *)0x0);
    }
  }
  return 0;
}

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)