From f7f7d48ce71a806e00dafd7305e689188465d204 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Tue, 11 Oct 2011 09:14:47 +0000 Subject: fixed player assignment in challenge mode git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2832 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UPartyM2.pas | 48 +++++++++++++++++++++++++++++++++++------- Game/Code/UltraStar.dpr | 2 +- 2 files changed, 41 insertions(+), 9 deletions(-) (limited to 'Game') diff --git a/Game/Code/Classes/UPartyM2.pas b/Game/Code/Classes/UPartyM2.pas index d776de96..2838546f 100644 --- a/Game/Code/Classes/UPartyM2.pas +++ b/Game/Code/Classes/UPartyM2.pas @@ -234,6 +234,10 @@ type else if r<3 then Result:=false + else if (num > 3) and ( + (ar[r-2].x=Pair.Player1) or (ar[r-2].y=Pair.Player1) or + (ar[r-2].x=Pair.Player2) or (ar[r-2].y=Pair.Player2)) then + Result := true // else if ((ar[r-2].x = Pair.Player1) and (ar[r-3].x = Pair.Player1)) or @@ -245,10 +249,9 @@ type ((ar[r-2].y = Pair.Player2) and (ar[r-3].x = Pair.Player2)) or ((ar[r-2].y = Pair.Player2) and (ar[r-3].y = Pair.Player2))then - Result:=true - + Result := true else - Result:=false; + Result := false; end; var @@ -258,6 +261,7 @@ var I, J, K: integer; arr: array of TFields; temp_pairs: array of TPair; + pairs_season: array of boolean; season: integer; num: integer; max_played: integer; @@ -310,6 +314,7 @@ begin //build the playlist SetLength (arr, 0); SetLength (arr, NumRounds); + SetLength (pairs_season, (NumPlayers*NumPlayers-NumPlayers) div 2); for I := 0 to NumRounds - 1 do begin @@ -349,8 +354,10 @@ begin for J := 0 to Length(Pairs) - 1 do begin + K := Floor(J / 2); + if (not HasPlayed(Pairs[J], arr, I+1, NumPlayers)) and - (Pairs[J].played=0) and ( @@ -371,9 +378,12 @@ begin begin for J := 0 to Length(Pairs) - 1 do begin + K := Floor(J / 2); + if (max_flag and ( (Player[Pairs[J].Player1].played