Map rotation touchup, automatic map votes (#48602)

* Map rotation touchup, automatic map votes

* votes already running

* Pre-init vote restrictions

* No rotation for rounds less than 10 minutes.

* Splits voting preferred map check

* Fixed comment
This commit is contained in:
skoglol
2020-01-07 09:46:49 -05:00
committed by Emmett Gaines
parent 59916c0f7e
commit 8206b1e1cb
6 changed files with 74 additions and 56 deletions
+6 -8
View File
@@ -6,7 +6,6 @@
return
message_admins("[key_name_admin(usr)] is forcing a random map rotation.")
log_admin("[key_name(usr)] is forcing a random map rotation.")
SSticker.maprotatechecked = 1
SSmapping.maprotate()
/client/proc/adminchangemap()
@@ -36,8 +35,7 @@
var/chosenmap = input("Choose a map to change to", "Change Map") as null|anything in sortList(maprotatechoices)|"Custom"
if (!chosenmap)
return
SSticker.maprotatechecked = 1
if(chosenmap == "Custom")
message_admins("[key_name_admin(usr)] is changing the map to a custom map")
log_admin("[key_name(usr)] is changing the map to a custom map")
@@ -46,29 +44,29 @@
VM.map_name = input("Choose the name for the map", "Map Name") as null|text
if(isnull(VM.map_name))
VM.map_name = "Custom"
var/map_file = input("Pick file:", "Map File") as null|file
if(isnull(map_file))
return
if(copytext("[map_file]",-4) != ".dmm")
to_chat(src, "<span class='warning'>Filename must end in '.dmm': [map_file]</span>")
return
if(!fcopy(map_file, "_maps/custom/[map_file]"))
return
// This is to make sure the map works so the server does not start without a map.
var/datum/parsed_map/M = new (map_file)
if(!M)
to_chat(src, "<span class='warning'>Map '[map_file]' failed to parse properly.</span>")
return
if(!M.bounds)
to_chat(src, "<span class='warning'>Map '[map_file]' has non-existant bounds.</span>")
qdel(M)
return
qdel(M)
var/shuttles = alert("Do you want to modify the shuttles?", "Map Shuttles", "Yes", "No")