Kromtec / LegendsViewer

Recreates Dwarf Fortress' Legends Mode from exported files.
GNU General Public License v3.0
62 stars 19 forks source link

Fixed a crash related to civilisations lost to the end of stream. #2

Closed Alexei-B closed 8 years ago

Alexei-B commented 8 years ago

If while parsing a history file, the file ends with the name of a civilisation, end of stream will trigger and the civilisation will never be parsed. This will later result in a crash when attempting to print the WorldStatsPrinter. I addressed this by checking if a remaining current line is left unparsed post closing the history file, and then testing and parsing it as a civilisation. This needed a new EoS oriented function to avoid calling ReadLine while handling the civ, however due to it being the last line does not require worship or leadership parsing.

Kromtec commented 8 years ago

Very nice! Keep it up!