-
-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mp_create_game: Show preview if map_file is set #4407
Conversation
yes. The result of the map generator is stored in the map_data attribute , so that code checks whether the map was already generated and does so if it didnt happen yet. |
from looking at the code im suprised this works, since all codes you are changing are inside |
@gfgtdf That branch of the
|
right, forogt how C++ switch works for a second. but don't we use FALLTHROUGH for intentional fallthough switches and don't he compiler give a wanring for missing FALLTHROUGH? |
Compilers probably suppress that warning when a label is followed by another label with no statements in between. Anyway, falling through happens whenever there's no |
By the way, I wanted to put somewhere an accessor function, foo::map_data() that just gets the map_data from either the |
Factoring the code out to a common function sounds good. Not sure where to put it either though. |
I could just create a non-member function somewhere and have the three places use it. Even if that's not the best possible place to declare the function in, we can move it to a more suitable home when we come up with one. CC @Vultraz |
well at least one of three function that use map_file don't 'access' it they, read map_file and store it into map_data. So not sure how muhc there is in common actually. |
I thought of a function that takes a config object and returns a string. That string will be |
hmm no the saved_game code does more like |
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works
@@ -4,7 +4,7 @@ | |||
name= _ "2p — Aethermaw" | |||
# wmllint: local spellings Sulla Aethermaw Paterson | |||
description= _ "Long ago, the Great Mage Sulla was imprisoned in the Aethermaw, a nexus of mystical energy whose chaotic nature was able to prevent her escape. Over the centuries, however, Sulla gradually attuned her powers to the maelstrom of disorder that is the Aethermaw, and has now begun to project its influence onto the material plane, drawing in entire regions of land from hundreds of different worlds, realities and time-periods. She experiments with these disparate pieces of the cosmos, manipulating them, merging them and sending them back and forth between the Aethermaw and their place of origin. Perhaps, as her mastery over the Aethermaw grows, Sulla will one day break free of its bonds. Until that time comes, she will continue to amuse herself by arranging battles between the mortal beings unlucky enough to be drawn into its depths. Designed by Doc Paterson." | |||
map_data="{multiplayer/maps/2p_Aethermaw.map}" | |||
map_file=multiplayer/maps/2p_Aethermaw.map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error validation: Invalid key 'map_file=' in tag [multiplayer]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rebase should fix this.
67dd920
to
d9d794d
Compare
Fixes the second bullet of #4397 (comment).
Could someone double check the change to the generator_assigned condition? Is it about the case that a scenario file defines both map_file and a map generator? I would have expected that to be an error, actually.