From: Holger Schemel Date: Sat, 29 Feb 2020 13:49:35 +0000 (+0100) Subject: fixed bug with playing EM level with inactive player X-Git-Tag: 4.2.0.0~62 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=155484223b5bed1218883009f86a6e5714c41bdb fixed bug with playing EM level with inactive player --- 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)