• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fix in Progress Bug when recreating existing profile

Hammie

Storm Engine developer
Staff member
Storm Modder
Found a bug that caused the game to go a bit crazy when recreating an existing save game profile and then loading it.

Steps to reproduce:
- Create 3 different profiles for the same storyline (mine were called "map", "Player", and "Test", but I don't think that matters).
- Recreate the 2nd one ("Player")
- Save and load the game.
- Go to main menu -> Load -> See how the savegames and profiles are incorrect. Game also goes a bit crazy and even remaps your key bindings somehow.

This was caused by the game deleting the 2nd profile, then recreating it in profile slot (number_of_profiles + 1) = 3, which is actually already using by the 3rd profile ("Test").

I fixed it by instead looking for the first empty profile slot available, when creating new profiles.

For easy comparison: Github diff

@Grey Roger Can you include this in the next patch?
 

Attachments

  • utils.c
    68.3 KB · Views: 55
Your version appears to have a lot of different character assignments in functions 'touppereng' and other language variants of it, various different language variants of 'tolower', 'GetDiacriticalChar', 'ChrFromCode' and 'ascii'. (Could that be the reason for the remapping of key bindings?)

But presumably the important part is the addition of function 'FindEmptyProfileSlot' and its use in 'CreateProfile'. I'll add that to my version of "PROGRAM\utils.c" and see if it has any odd side effects.
 
Your version appears to have a lot of different character assignments in functions 'touppereng' and other language variants of it, various different language variants of 'tolower', 'GetDiacriticalChar', 'ChrFromCode' and 'ascii'. (Could that be the reason for the remapping of key bindings?)
That is the result of file encoding changes for the new engine, sorry.

It is indeed just 'FindEmptyProfileSlot' and 'CreateProfile'. You can also check the Github link to see the exact changes at a glance.
 
Back
Top