From 03c41e6e5854829a14dd274d1c8d1c2b61121a35 Mon Sep 17 00:00:00 2001
From: johns <>
Date: Wed, 22 May 2002 20:25:01 +0000
Subject: [PATCH] Fixed player problems with campaign and command line
 starting.

---
 doc/ChangeLog.html          | 2 ++
 src/game/campaign.cpp       | 4 ++--
 src/stratagus/player.cpp    | 1 +
 src/stratagus/stratagus.cpp | 7 ++++---
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/doc/ChangeLog.html b/doc/ChangeLog.html
index 3fbb2bd87..803714b19 100644
--- a/doc/ChangeLog.html
+++ b/doc/ChangeLog.html
@@ -815,6 +815,8 @@
     <LI>Fixed bug #557954: Opponent's action markers are visible.
     <LI>The tips are only shown in the single player game.
     <LI>Multiplayer menus should now work. (from Ari)
+    <LI>Final:
+    <LI>Fixed bug: Player are wrong assigned in campaign.
     <LI>+++
     </UL>
 
diff --git a/src/game/campaign.cpp b/src/game/campaign.cpp
index c1e78f6fd..52cd6647e 100644
--- a/src/game/campaign.cpp
+++ b/src/game/campaign.cpp
@@ -51,8 +51,8 @@ global char DefaultObjective[] = "-Destroy your enemies";
 
 global int GameResult;			/// Outcome of the game
 global char CurrentMapPath[1024];	/// Path of the current map
-global int RestartScenario=0;		/// Restart the scenario
-global int QuitToMenu=0;		/// Quit to menu
+global int RestartScenario;		/// Restart the scenario
+global int QuitToMenu;			/// Quit to menu
 global Campaign* Campaigns;		/// Campaigns
 global int NumCampaigns;		/// Number of campaigns
 
diff --git a/src/stratagus/player.cpp b/src/stratagus/player.cpp
index 2aba2d85b..2b4fc97f8 100644
--- a/src/stratagus/player.cpp
+++ b/src/stratagus/player.cpp
@@ -284,6 +284,7 @@ global void CreatePlayer(int type)
     //  Allocate memory for the "list" of this player's units.
     //  FIXME: brutal way, as we won't need UnitMax for this player...
     //	FIXME: ARI: is this needed for 'PlayerNobody' ??
+    //	FIXME:	A: Johns: currently we need no init for the nobody player.
     if( !(player->Units=(Unit**)calloc(UnitMax,sizeof(Unit*))) ) {
 	DebugLevel0("Not enough memory to create player %d.\n",NumPlayers);
 	return;
diff --git a/src/stratagus/stratagus.cpp b/src/stratagus/stratagus.cpp
index 48bf78afa..fb82b275c 100644
--- a/src/stratagus/stratagus.cpp
+++ b/src/stratagus/stratagus.cpp
@@ -868,12 +868,13 @@ global void MenuLoop(char* filename, WorldMap* map)
 	    EnableRedraw=RedrawMenu;
 	    ProcessMenu(MENU_PRG_START, 1);
 	    EnableRedraw=RedrawEverything;
-	    if( NetworkFildes!=-1 && NetPlayers<2 ) {
-		ExitNetwork1();
-	    }
 	    DebugLevel0Fn("Menu start: NetPlayers %d\n", NetPlayers);
 	    filename = CurrentMapPath;
 	}
+	if( NetworkFildes!=-1 && NetPlayers<2 ) {
+	    ExitNetwork1();
+	}
+
 	//
 	//	Create the game.
 	//