Author Topic: [BUG][PLAYER] Program crashes on startup if level file missing  (Read 2546 times)

0 Members and 1 Guest are viewing this topic.

Offline Crane

  • Posts: 1079
    • View Profile
[BUG][PLAYER] Program crashes on startup if level file missing
« 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.

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [BUG][PLAYER] Program crashes on startup if level file missing
« Reply #1 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.
My Lemmings 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)

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [BUG][PLAYER] Program crashes on startup if level file missing
« Reply #2 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
My Lemmings 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)