MapTapeEjectButton();
}
-void TapeAddAction(byte action[MAX_PLAYERS])
+boolean TapeAddAction(byte action[MAX_PLAYERS])
{
int i;
if (changed_events || tape.pos[tape.counter].delay >= 255)
{
+ if (tape.counter >= MAX_TAPE_LEN - 1)
+ return FALSE;
+
tape.counter++;
tape.pos[tape.counter].delay = 0;
}
tape.pos[tape.counter].delay++;
}
+
+ return TRUE;
}
void TapeRecordAction(byte action_raw[MAX_PLAYERS])
if (!tape.recording) /* (record action even when tape is paused) */
return;
- if (tape.counter >= MAX_TAPE_LEN - 1)
- {
- TapeStopRecording();
- return;
- }
-
for (i = 0; i < MAX_PLAYERS; i++)
action[i] = action_raw[i];
tape.set_centered_player = FALSE;
}
- TapeAddAction(action);
+ if (!TapeAddAction(action))
+ TapeStopRecording();
}
void TapeTogglePause(boolean toggle_mode)