From 155484223b5bed1218883009f86a6e5714c41bdb Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 29 Feb 2020 14:49:35 +0100 Subject: [PATCH] fixed bug with playing EM level with inactive player --- src/engines.h | 1 + src/game_em/convert.c | 2 +- src/tools.c | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/engines.h b/src/engines.h index bce30217..f5186855 100644 --- a/src/engines.h +++ b/src/engines.h @@ -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); diff --git a/src/game_em/convert.c b/src/game_em/convert.c index d8a202d6..6b09ece6 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -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) { diff --git a/src/tools.c b/src/tools.c index 078af1ba..1dbc1a55 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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) -- 2.34.1