moved code for fixing single-player tapes to separate function
[rocksndiamonds.git] / src / tape.c
index 4894f1137bc9fb54fec3b5e7b81c03bcfae4fc56..29886a5c7346da27c25a3b3b5b538d0f8e982a5d 100644 (file)
@@ -1145,6 +1145,22 @@ boolean PlaySolutionTape(void)
   return TRUE;
 }
 
+void FixTape_ForceSinglePlayer(void)
+{
+  int i;
+
+  /* fix single-player tapes that contain player input for more than one
+     player (due to a bug in 3.3.1.2 and earlier versions), which results
+     in playing levels with more than one player in multi-player mode,
+     even though the tape was originally recorded in single-player mode */
+
+  // remove player input actions for all players but the first one
+  for (i = 1; i < MAX_PLAYERS; i++)
+    tape.player_participates[i] = FALSE;
+
+  tape.changed = TRUE;
+}
+
 
 // ----------------------------------------------------------------------------
 // tape autoplay functions