fixed bug with playing EM level with inactive player
authorHolger Schemel <info@artsoft.org>
Sat, 29 Feb 2020 13:49:35 +0000 (14:49 +0100)
committerHolger Schemel <info@artsoft.org>
Tue, 19 May 2020 16:20:01 +0000 (18:20 +0200)
src/engines.h
src/game_em/convert.c
src/tools.c

index bce3021715d77d8fdc907af876e3af33828c320d..f51868556b3ae5408930c1d59d91a2f3f42a5135 100644 (file)
@@ -28,6 +28,7 @@
 void UpdateEngineValues(int, int, int, int);
 
 boolean getTeamMode_EM(void);
+boolean isActivePlayer_EM(int);
 
 void PlayLevelSound_EM(int, int, int, int);
 void InitGraphicInfo_EM(void);
index d8a202d6166883b03cc5fbcdbd8987c407a248c8..6b09ece6a7b26ec5a06e9e4975dbdf32d6b1a490 100644 (file)
@@ -404,7 +404,7 @@ void prepare_em_level(void)
   /* assign active players */
   for (i = 0; i < MAX_PLAYERS; i++)
   {
-    if (ply[i].exists)
+    if (ply[i].exists && isActivePlayer_EM(i))
     {
       if (players_left)
       {
index 078af1ba745e4fe6ae521f619d4a38d771d223cc..1dbc1a5549b53bd94b6710a1a263f27ed6b874fb 100644 (file)
@@ -8272,6 +8272,11 @@ boolean getTeamMode_EM(void)
   return game.team_mode || network_playing;
 }
 
+boolean isActivePlayer_EM(int player_nr)
+{
+  return stored_player[player_nr].active;
+}
+
 unsigned int InitRND(int seed)
 {
   if (level.game_engine_type == GAME_ENGINE_TYPE_EM)