Author Topic: [Fixed][Bug][Player] NL still runs and eats resources after crash  (Read 1418 times)

0 Members and 1 Guest are viewing this topic.

Offline IchoTolot

  • Global Moderator
  • Posts: 3612
    • View Profile
Reproducing:

- Get NL to crash (for example through renaming a levelfile in a pack and starting it).

- After the error messages NL has vanished on the deaktop.

- Open the task-manager.

- In there NL still runs and eats resources + this effect can stack multiple times.
« Last Edit: August 20, 2018, 06:34:54 PM by Nepster »

Offline Nepster

  • Posts: 1829
    • View Profile
Re: [Fixed][Bug][Player] NL still runs and eats resources after crash
« Reply #1 on: August 20, 2018, 06:36:12 PM »
You will love this bug :thumbsup:
1) If you try to play a level with no level file, NeoLemmix tries to go to the main menu once it notices this.
2) When exiting a level, it always tries to save your attempt in the userdata.nxsv file (where it keeps your best number of saved lemmings, best time, ...). It does this even for levels it couldn't load.
3) To determine which version you played, NeoLemmix computes the file age.
4) As the level file does not exist, it tries to convert the string "01/01/1980" to an internal data format (which is just a typedef for double, but that is another story altogether...).
5) This StrToDate method however uses the locale Windows formatting for both converting internal dates to string representations and back. For the US this is (usually) "dd/mm/yyyy" or "mm/dd/yyyy", so this conversion works. However in Europe, it expects its date formatted as "dd.mm.yyyy" (and yes, it really requires points as separators and cannot handle slashes!). Therefore this throws an EConvertError.
6) We are handling any errors here by aborting whatever we did and trying to load the main menu.
7) But because we are still coming from a level we go back to step 2), having arrived at a pretty, pretty infinite loop. :evil:

Offline IchoTolot

  • Global Moderator
  • Posts: 3612
    • View Profile
Re: [Fixed][Bug][Player] NL still runs and eats resources after crash
« Reply #2 on: August 20, 2018, 06:47:10 PM »