Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix game crashes when no maps are available to load #15565
Bug was reproduced on 2 scenarios:
The fix solves these 2 issues in a general way (by safely trying to iterate the maps (map previews) collection, and
Thank you for your contribution to OpenRA!
Please be aware that we do not have enough project maintainers to match the rate of contributions, so it may take several days before somebody is able to respond to your Pull Request.
You can help speed up the review process by following a few steps:
If you need any help you can ask in the #openra IRC channel on freenode (most active during European evenings).
Took a glimpse on the committed code - while I like your intention to throw a specific crash, such intense special error casing is unneeded IMO.
Although I'm notsure suddenly where the error message would appear ultimately, which might justify your ideals here. If TryWithPrompt is valid though, UtilityCommands is still a bad place for it - that's specific area for the OpenRA.Utility and not something which should be leaked back to our widget codebase IMO.
I agree with @GraionDilach: an
IMO the prompt would be better replaced by disabling the skirmish and create server buttons if no maps are available. IIRC we already do this for the Missions button if the mod doesn't define any missions.
To clarify my point above, this is what happens when no missions are available (greyed out means it can't be clicked):
It is controlled by this code:
You can do the same thing for Skirmish by doing something very similar to the line immediately below this block in