{
if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
{
- if (level.native_em_level->lev->home == 0) // all players at home
+ if (game_em.level_solved &&
+ !game_em.game_over) // game won
{
PlayerWins(local_player);
- AllPlayersGone = TRUE;
+ game_em.game_over = TRUE;
- level.native_em_level->lev->home = -1;
+ AllPlayersGone = TRUE;
}
- if (level.native_em_level->ply[0]->alive == 0 &&
- level.native_em_level->ply[1]->alive == 0 &&
- level.native_em_level->ply[2]->alive == 0 &&
- level.native_em_level->ply[3]->alive == 0) // all dead
+ if (game_em.game_over) // game lost
AllPlayersGone = TRUE;
}
else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
return FALSE;
if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
- return (level.native_em_level->lev->home > 0);
+ return (game_em.game_over && !game_em.level_solved);
else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
return (game_sp.game_over && !game_sp.level_solved);
else if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
// - game_em.use_single_button (default: TRUE)
// - game_em.use_snap_key_bug (default: FALSE)
+ game_em.level_solved = FALSE;
+ game_em.game_over = FALSE;
+
game_em.any_player_moving = FALSE;
game_em.any_player_snapping = FALSE;
if (ply[0].alive || ply[1].alive || ply[2].alive || ply[3].alive)
lev.score += score; /* only add a score if someone is alive */
+ else
+ game_em.game_over = TRUE;
RandomEM = random;