tmewett / BrogueCE

Brogue: Community Edition - a community-lead fork of the much-loved minimalist roguelike game
https://sites.google.com/site/broguegame/
GNU Affero General Public License v3.0
1.03k stars 109 forks source link

Ensuring recording buffer is always flushed even with no recording file #633

Closed flend closed 11 months ago

flend commented 11 months ago

This is a pretty hands-off fix for the issue where the recording buffer is never flushed when using --print-seed-catalog. The real fix is to ensure that flushBufferToFile will always flush the buffer, regardless of if a recording file is present. Guarding is also added to recordChar to avoid buffer overflows. This change avoids creating a new game state of isPrintingSeedCatalog. An addition we could do is to avoid writing to the recording buffer if there is no recording file.

flend commented 11 months ago

Updated so as to not break all recordings. flushBufferToFile is called during playback but should be a no-op since locationInRecordingBuffer is being used for playback.