From 9a14e4dcb951d4db5cb63b25909bd2ff4f41e1fe Mon Sep 17 00:00:00 2001 From: LT3 <83487515+lessthnthree@users.noreply.github.com> Date: Mon, 17 Feb 2025 12:15:36 -0800 Subject: [PATCH] Fix map vote revert, add admin verb (#89505) ## About The Pull Request Fixes revert_next_map() not actually reverting the map vote. Also added an admin verb for it for ease of access. ## Why It's Good For The Game Fix bug, revert map vote without having to poke around in the subsystem. ## Changelog :cl: LT3 fix: Revert next map command actually reverts the map vote admin: Admins now have a verb to revert the map vote /:cl: --- code/controllers/subsystem/map_vote.dm | 7 ++++++- code/modules/admin/verbs/maprotation.dm | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/code/controllers/subsystem/map_vote.dm b/code/controllers/subsystem/map_vote.dm index 9d139dfd74a..0e0aea03905 100644 --- a/code/controllers/subsystem/map_vote.dm +++ b/code/controllers/subsystem/map_vote.dm @@ -154,7 +154,7 @@ SUBSYSTEM_DEF(map_vote) next_map_config = change_to return TRUE -/datum/controller/subsystem/map_vote/proc/revert_next_map() +/datum/controller/subsystem/map_vote/proc/revert_next_map(client/user) if(!next_map_config) return if(previous_cache) @@ -163,6 +163,11 @@ SUBSYSTEM_DEF(map_vote) already_voted = FALSE admin_override = FALSE + next_map_config = null + + if(!isnull(user)) + message_admins("[key_name_admin(user)] has reverted the next map selection. Voting re-enabled.") + log_admin("[key_name_admin(user)] reverted the next map selection.") send_map_vote_notice("Next map reverted. Voting re-enabled.") #undef MAP_VOTE_CACHE_LOCATION diff --git a/code/modules/admin/verbs/maprotation.dm b/code/modules/admin/verbs/maprotation.dm index 1749e5a5b6a..ee9fcf36301 100644 --- a/code/modules/admin/verbs/maprotation.dm +++ b/code/modules/admin/verbs/maprotation.dm @@ -114,3 +114,6 @@ ADMIN_VERB(admin_change_map, R_SERVER, "Change Map", "Set the next map.", ADMIN_ if (SSmap_vote.set_next_map(virtual_map)) message_admins("[key_name_admin(user)] has changed the map to [virtual_map.map_name]") SSmap_vote.admin_override = TRUE + +ADMIN_VERB(admin_revert_map, R_SERVER, "Revert Map Vote", "Revert the map vote, allowing a new vote.", ADMIN_CATEGORY_SERVER) + SSmap_vote.revert_next_map(user)