space-station-14
space-station-14 copied to clipboard
Refactor GameMapManager a bit (nukes mapforced)
About the PR
Closes #7192 Fixes an untracked issue where the map name in the lobby screen is sometimes incorrect
changed behavior:
- cvar
mapforced
is depreciated - cvar
map
now forces the GameMapManager to always load the given map - Set the cvar to the empty string
sudo cvar game.map ""
orforcemap ""
to stop forcing the map. - console command
forcemap
now sets themap
cvar (redundant now but eh) - voting for maps only works in the pre-round lobby and will display an error message in other situations
- standard votes should have better code for detecting valid conditions but that's outside scope for this
unchanged behavior:
-
map_rotation
(defaults to true) causes GameMapManager to use the rotation queue when selecting the map - if
map
is empty andmap_rotation
is false, a random eligible map will be selected (I think this is unchanged)
notes:
This started as a simple investigation into removing forcemap
and quickly grew into a medium-sized refactor of GameMapManager
and connected code. More work is ~~probably~~ needed to push this closer to what it actually needs to be, but that can happen later.
Something to keep in mind is that GameMapManager._selectedMap
needs to be unchanged during the round so that the lobby has the correct information. Currently the functions inside GameMapManager
don't actually prevent this, so just don't it™. This is why map voting has been restricted to the pre-round lobby.
cvar map now forces the GameMapManager to always load the given map console command forcemap now sets the map cvar (redundant now but eh)
So how do you unforce a map? ctrl + f shows nothing else changes that CVar but maybe I'm missing something
voting for maps only works in the pre-round lobby and will display an error message in other situations
Why is this desirable behavior?
Set the cvar to the empty string sudo cvar game.map ""
or forcemap ""
to stop forcing the map. (added to op)
I couldn't find a way to make map voting during the round work cleanly. Perhaps I'll take another look for this PR but honestly it's not that bad a restriction. Votes on the whole are kinda broken.
Ok the lobby is now reading from the MetaDataComponent
attached to each loaded station. With that change in mind, should we change the description text in the lobby? From "The current map is" to something like "The current station is"?
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
oh my gosh thanks for doing the merge part of this ❤️ I will look at the feedback right away