[BUG][PLAYER] Program crashes on startup if level file missing

Started by Crane, February 26, 2023, 09:48:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Crane

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.

namida

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.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

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
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)