Skip to content

[editor] Flawed mapsettings when opening a map / test #548

@chris1384

Description

@chris1384

Which resource(s) have this problem?
editor_main

Describe the bug
Upon loading a map after the editor just started, or when a player pressed the New map button, loading a small map does not cache its settings properly into editor. This can be observed by the weather not changing, missing map info and the errors that come after testing it.

When the map opened properly, changing any settings, testing it then come back to editor, the map settings revert back to the old ones.
Possible culprit:

setTimer(passNewMapSettings, 1000, 1)

To Reproduce

  1. Start editor
  2. Load a tiny map that has a few elements in it.
  3. Observe how the map settings are broken > reverted to default settings
  4. Test it using a gamemode (eg. race), mapmanager failed to start the map (<info> was not written into meta.xml)

Screenshots
https://www.youtube.com/watch?v=FfJkeqOLL8I

Additional context
After finishing the map test, it goes into black screen. But the map can be tested using F5 again, then the map will be loaded properly.
Weirdly enough, if you open a map for the second time it does load as usual, and can be played without issues.

Possible fixes for map open
// 1


Change this to a timer with delay 200:
setTimer(passNewMapSettings, 200, 1)

// 2 - by @q8X


Increase the delay of this to 100 or even 200.

I will not do a PR because this is experimental and there are probably better alternatives, it's just the matter of finding them.
Awaiting feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions