Lemmings Forums

NeoLemmix => Bugs & Suggestions => Engine Bugs / Suggestions => Topic started by: Crane on February 26, 2023, 09:48:29 AM

Title: [BUG][PLAYER] Program crashes on startup if level file missing
Post by: Crane on February 26, 2023, 09:48:29 AM
If you delete or rename etc. the file that corresponds to the level that was last played when the program closes (so it is the one that's selected when you next start up), the program crashes with the message "An error occured while trying to save data.", and then when that dialog box is cleared, the standard Delphi exception message appears: "Exception TIconImage in module NeoLemmix.exe at 003252EA" before terminating.

This should be handled more cleanly, either displaying a warning or silently ignoring it and setting the last played level to something default.
Title: Re: [BUG][PLAYER] Program crashes on startup if level file missing
Post by: namida on February 26, 2023, 06:46:43 PM
I'm sure I remember coding a fallback for specifically this case; with the behavior being that it would get as close as it could. (ie: Let's say the last level played was a level in Tricky of Orig; if that level is now missing, it'll go to the first unsolved level, or maybe just the first level full stop, of Tricky; if the entire Tricky rank is missing or has no levels, it'll go to the first of Orig as a whole; and if the entire pack is gone, just to the first level you have in your levels folder)

It'd seem though, either I only thought about doing this, or it broke at some point.
Title: Re: [BUG][PLAYER] Program crashes on startup if level file missing
Post by: namida on July 19, 2023, 06:38:51 AM
I can't reproduce this exactly. I do get an error when trying to actually play the level (not just opening NL) if the file is deleted but still referenced by a levels.nxmi file; while NL behaves as expected if the level was just a loose file. I would class "levels.nxmi file references a non-existant level" as an issue with the input.

Can you clarify anything else about when this happened? eg. was the level loose in the main "levels" folder, or in a subfolder of loose levels, or in a folder with a levels.nxmi? Were any other levels left in the same folder afterwards? etc