From 77bbf0e540a40a3de17f389f63925cbb676a48dd Mon Sep 17 00:00:00 2001 From: avolkov Date: Wed, 1 Jul 2009 05:33:28 +0000 Subject: [PATCH] Fixed random-selecting ships in netplay git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3165 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/pickmele.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sc2/src/sc2code/pickmele.c b/sc2/src/sc2code/pickmele.c index e3d6ba083..959589fb2 100644 --- a/sc2/src/sc2code/pickmele.c +++ b/sc2/src/sc2code/pickmele.c @@ -529,6 +529,7 @@ GetMeleeStarShips (COUNT playerMask, HSTARSHIP *ships) BOOLEAN ok; GETMELEE_STATE gmstate; TimeCount now; + COUNT i; #ifdef NETPLAY for (playerI = 0; playerI < NUM_PLAYERS; playerI++) @@ -554,8 +555,10 @@ GetMeleeStarShips (COUNT playerMask, HSTARSHIP *ships) now = GetTimeCounter (); gmstate.InputFunc = DoGetMelee; gmstate.Initialized = FALSE; - for (playerI = 0; playerI < NUM_PLAYERS; playerI++) + for (i = 0; i < NUM_PLAYERS; ++i) { + // We have to use TFB_Random() results in specific order + playerI = GetPlayerOrder (i); gmstate.player[playerI].selecting = (playerMask & (1 << playerI)) != 0; gmstate.player[playerI].ships_left = battle_counter[playerI];