mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 21:48:39 +01:00
Persistent Map Vote Tallies (#86788)
## About The Pull Request Changes map votes to be based on a persistent tally count. Tallies for maps are cached between rounds and are added to by map votes. When a map is chosen, and it wasn't the only valid one, the tallies for said chosen map will be reset. Refactors map vote handling and moves it from SSmapping to SSmap_vote. Rock the Vote has been removed as a result of this refactor. ## Why It's Good For The Game Makes it more likely that all maps will be played over the course of a server instead of always being truly random. Removes some clutter off of SSmapping. 🆑 refactor: Map Votes are now carried over between rounds. When a map vote is actually a contest, the winning map will have its votes reset. /🆑
This commit is contained in:
@@ -1,12 +1,3 @@
|
||||
|
||||
ADMIN_VERB(force_random_rotate, R_SERVER, "Trigger 'Random' Map Rotation", "Force a map vote.", ADMIN_CATEGORY_SERVER)
|
||||
var/rotate = tgui_alert(user,"Force a random map rotation to trigger?", "Rotate map?", list("Yes", "Cancel"))
|
||||
if (rotate != "Yes")
|
||||
return
|
||||
message_admins("[key_name_admin(user)] is forcing a random map rotation.")
|
||||
log_admin("[key_name(user)] is forcing a random map rotation.")
|
||||
SSmapping.maprotate()
|
||||
|
||||
ADMIN_VERB(admin_change_map, R_SERVER, "Change Map", "Set the next map.", ADMIN_CATEGORY_SERVER)
|
||||
var/list/maprotatechoices = list()
|
||||
for (var/map in config.maplist)
|
||||
@@ -119,14 +110,14 @@ ADMIN_VERB(admin_change_map, R_SERVER, "Change Map", "Set the next map.", ADMIN_
|
||||
fdel(PATH_TO_NEXT_MAP_JSON)
|
||||
text2file(json_encode(json_value), PATH_TO_NEXT_MAP_JSON)
|
||||
|
||||
if(SSmapping.changemap(virtual_map))
|
||||
if(SSmap_vote.set_next_map(virtual_map))
|
||||
message_admins("[key_name_admin(user)] has changed the map to [virtual_map.map_name]")
|
||||
SSmapping.map_force_chosen = TRUE
|
||||
SSmap_vote.admin_override = TRUE
|
||||
fdel("data/custom_map_json/[config_file]")
|
||||
else
|
||||
var/datum/map_config/virtual_map = maprotatechoices[chosenmap]
|
||||
message_admins("[key_name_admin(user)] is changing the map to [virtual_map.map_name]")
|
||||
log_admin("[key_name(user)] is changing the map to [virtual_map.map_name]")
|
||||
if (SSmapping.changemap(virtual_map))
|
||||
if (SSmap_vote.set_next_map(virtual_map))
|
||||
message_admins("[key_name_admin(user)] has changed the map to [virtual_map.map_name]")
|
||||
SSmapping.map_force_chosen = TRUE
|
||||
SSmap_vote.admin_override = TRUE
|
||||
|
||||
Reference in New Issue
Block a user