projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3256486
)
changed code position of check if tape is full when adding actions
author
Holger Schemel
<info@artsoft.org>
Wed, 10 Jan 2018 10:53:46 +0000
(11:53 +0100)
committer
Holger Schemel
<info@artsoft.org>
Wed, 10 Jan 2018 10:53:46 +0000
(11:53 +0100)
src/tape.c
patch
|
blob
|
history
diff --git
a/src/tape.c
b/src/tape.c
index 38edafc59d6503b61e167c97f1ec16c1f8aadbe5..e42540362be36ba299b4157ed4904b707cc83b42 100644
(file)
--- a/
src/tape.c
+++ b/
src/tape.c
@@
-660,7
+660,7
@@
void TapeStopRecording()
MapTapeEjectButton();
}
MapTapeEjectButton();
}
-
void
TapeAddAction(byte action[MAX_PLAYERS])
+
boolean
TapeAddAction(byte action[MAX_PLAYERS])
{
int i;
{
int i;
@@
-674,6
+674,9
@@
void TapeAddAction(byte action[MAX_PLAYERS])
if (changed_events || tape.pos[tape.counter].delay >= 255)
{
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.counter++;
tape.pos[tape.counter].delay = 0;
}
@@
-688,6
+691,8
@@
void TapeAddAction(byte action[MAX_PLAYERS])
tape.pos[tape.counter].delay++;
}
tape.pos[tape.counter].delay++;
}
+
+ return TRUE;
}
void TapeRecordAction(byte action_raw[MAX_PLAYERS])
}
void TapeRecordAction(byte action_raw[MAX_PLAYERS])
@@
-698,12
+703,6
@@
void TapeRecordAction(byte action_raw[MAX_PLAYERS])
if (!tape.recording) /* (record action even when tape is paused) */
return;
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];
for (i = 0; i < MAX_PLAYERS; i++)
action[i] = action_raw[i];
@@
-717,7
+716,8
@@
void TapeRecordAction(byte action_raw[MAX_PLAYERS])
tape.set_centered_player = FALSE;
}
tape.set_centered_player = FALSE;
}
- TapeAddAction(action);
+ if (!TapeAddAction(action))
+ TapeStopRecording();
}
void TapeTogglePause(boolean toggle_mode)
}
void TapeTogglePause(boolean toggle_mode)