[MIRROR] Fixes being able to vote for maps which are outside their configured population range [MDB IGNORE] (#11255)

* Fixes being able to vote for maps which are outside their configured population range (#64619)

* fixes map voting?

* this is worth checking as well

* additional logging

* Fixes being able to vote for maps which are outside their configured population range

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-02-03 10:01:37 +00:00
committed by GitHub
co-authored by MrMelbert
parent 7c1c642381
commit 7b0c2c03e9
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -438,6 +438,13 @@ GLOBAL_LIST_EMPTY(the_station_areas)
message_admins("Failed to set new map with next_map.json for [VM.map_name]! Using default as backup!")
return
if (VM.config_min_users > 0 && GLOB.clients.len < VM.config_min_users)
message_admins("[VM.map_name] was chosen for the next map, despite there being less current players than its set minimum population range!")
log_game("[VM.map_name] was chosen for the next map, despite there being less current players than its set minimum population range!")
if (VM.config_max_users > 0 && GLOB.clients.len > VM.config_max_users)
message_admins("[VM.map_name] was chosen for the next map, despite there being more current players than its set maximum population range!")
log_game("[VM.map_name] was chosen for the next map, despite there being more current players than its set maximum population range!")
next_map_config = VM
return TRUE
+4
View File
@@ -197,6 +197,10 @@ SUBSYSTEM_DEF(vote)
var/datum/map_config/VM = config.maplist[map]
if(!VM.votable || (VM.map_name in SSpersistence.blocked_maps) || GLOB.clients.len >= VM.config_max_users || GLOB.clients.len <= VM.config_min_users) //SKYRAT EDIT CHANGE - ORIGINAL: if(!VM.votable || (VM.map_name in SSpersistence.blocked_maps))
continue
if (VM.config_min_users > 0 && GLOB.clients.len < VM.config_min_users)
continue
if (VM.config_max_users > 0 && GLOB.clients.len > VM.config_max_users)
continue
maps += VM.map_name
shuffle_inplace(maps)
for(var/valid_map in maps)