if (game_status != GAME_MODE_PLAYING)
return;
-#if 1
-
+ /* !!! FIX THIS (START) !!! */
+ if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
{
+ byte *recorded_player_action;
byte summarized_player_action = 0;
+ byte tape_action[MAX_PLAYERS];
int i;
+ if (tape.pausing)
+ return;
+
+ recorded_player_action = (tape.playing ? TapePlayAction() : NULL);
+
for (i = 0; i < MAX_PLAYERS; i++)
+ {
summarized_player_action |= stored_player[i].action;
- if (em_main_handle_game(summarized_player_action) != 0)
+ if (!network_playing)
+ stored_player[i].effective_action = stored_player[i].action;
+ }
+
+ if (!options.network && !setup.team_mode)
+ local_player->effective_action = summarized_player_action;
+
+ if (recorded_player_action != NULL)
+ for (i = 0; i < MAX_PLAYERS; i++)
+ stored_player[i].effective_action = recorded_player_action[i];
+
+ for (i = 0; i < MAX_PLAYERS; i++)
{
- game_status = GAME_MODE_MAIN;
- DrawMainMenu();
+ tape_action[i] = stored_player[i].effective_action;
+
+ /* !!! (this does not happen in the EM engine) !!! */
+ if (tape.recording && tape_action[i] && !tape.player_participates[i])
+ tape.player_participates[i] = TRUE; /* player just appeared from CE */
}
- }
-#else
+ /* only save actions from input devices, but not programmed actions */
+ if (tape.recording)
+ TapeRecordAction(tape_action);
- if (local_player->LevelSolved)
- GameWon();
+ GameActions_EM(local_player->effective_action);
- if (AllPlayersGone && !TAPE_IS_STOPPED(tape))
- TapeStop();
+ if (TimeFrames >= FRAMES_PER_SECOND)
+ {
+ TimeFrames = 0;
+ TapeTime++;
- GameActions();
- BackToFront();
+ if (tape.recording || tape.playing)
+ DrawVideoDisplay(VIDEO_STATE_TIME_ON, TapeTime);
+ }
- if (tape.auto_play && !tape.playing)
- AutoPlayTape(); /* continue automatically playing next tape */
+ TimeFrames++;
-#endif
+ BackToFront();
+ }
+ else
+ {
+ if (local_player->LevelSolved)
+ GameWon();
+
+ if (AllPlayersGone && !TAPE_IS_STOPPED(tape))
+ TapeStop();
+
+ GameActions();
+ BackToFront();
+
+ if (tape.auto_play && !tape.playing)
+ AutoPlayTape(); /* continue automatically playing next tape */
+ }
}
/* ---------- new screen button stuff -------------------------------------- */