diff --git a/code/game/gamemodes/game_mode_latespawn.dm b/code/game/gamemodes/game_mode_latespawn.dm index 4c8b85f49a..706bec63e6 100644 --- a/code/game/gamemodes/game_mode_latespawn.dm +++ b/code/game/gamemodes/game_mode_latespawn.dm @@ -6,6 +6,7 @@ var/list/usable_templates = list() for(var/datum/antagonist/A in supplied_templates) if(A.can_late_spawn()) + message_admins("AUTO[capitalize(name)]: [A.id] selected for spawn attempt.") usable_templates |= A return usable_templates @@ -28,7 +29,7 @@ if(world.time < next_spawn) return - next_spawn = world.time + rand(min_autotraitor_delay, max_autotraitor_delay) + message_admins("AUTO[capitalize(name)]: Attempting spawn.") var/list/usable_templates if(latejoin_only && latejoin_templates.len) @@ -36,8 +37,16 @@ else if (antag_templates && antag_templates.len) usable_templates = get_usable_templates(antag_templates) else + message_admins("AUTO[capitalize(name)]: Failed to find configured mode spawn templates, please disable auto-antagonists until one is added.") + round_autoantag = 0 return - if(usable_templates.len) + while(usable_templates.len) var/datum/antagonist/spawn_antag = pick(usable_templates) - spawn_antag.attempt_late_spawn(player) + usable_templates -= spawn_antag + if( spawn_antag.attempt_late_spawn(player)) + message_admins("AUTO[capitalize(name)]: Attempting to latespawn [spawn_antag.id]. ([spawn_antag.get_antag_count()]/[spawn_antag.cur_max])") + next_spawn = world.time + rand(min_autotraitor_delay, max_autotraitor_delay) + return + message_admins("AUTO[capitalize(name)]: Failed to find a viable spawn template.") + next_spawn = world.time + rand(min_autotraitor_delay, max_autotraitor_delay) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 32b7ec927b..b660c77803 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1362,3 +1362,45 @@ proc/admin_notice(var/message, var/rights) tomob.ckey = frommob.ckey qdel(frommob) return 1 + +/datum/admins/proc/force_antag_latespawn() + set category = "Admin" + set name = "Force Template Spawn" + set desc = "Should fix any mob sprite update errors." + + if (!istype(src,/datum/admins)) + src = usr.client.holder + if (!istype(src,/datum/admins)) + usr << "Error: you are not an admin!" + return + + if(!ticker || !ticker.mode) + usr << "Mode has not started." + return + + var/antag_type = input("Choose a template.","Force Latespawn") as null|anything in all_antag_types + if(!antag_type || !all_antag_types[antag_type]) + return + + var/datum/antagonist/antag = all_antag_types[antag_type] + log_admin("[key_name(usr)] attempting to force latespawn with template [antag.id].") + antag.attempt_late_spawn() + +/datum/admins/proc/force_mode_latespawn() + set category = "Admin" + set name = "Force Mode Spawn" + set desc = "Should fix any mob sprite update errors." + + if (!istype(src,/datum/admins)) + src = usr.client.holder + if (!istype(src,/datum/admins)) + usr << "Error: you are not an admin!" + return + + if(!ticker || !ticker.mode) + usr << "Mode has not started." + return + + log_admin("[key_name(usr)] attempting to force mode latespawn.") + ticker.mode.next_spawn = 0 + ticker.mode.try_latespawn() diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 882ba4f441..d628a7bef3 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -16,6 +16,8 @@ var/list/admin_verbs_admin = list( /client/proc/invisimin, /*allows our mob to go invisible/visible*/ // /datum/admins/proc/show_traitor_panel, /*interface which shows a mob's mind*/ -Removed due to rare practical use. Moved to debug verbs ~Errorage /datum/admins/proc/show_game_mode, /*Configuration window for the current game mode.*/ + /datum/admins/proc/force_mode_latespawn, /*Force the mode to try a latespawn proc*/ + /datum/admins/proc/force_antag_latespawn, /*Force a specific template to try a latespawn proc*/ /datum/admins/proc/toggleenter, /*toggles whether people can join the current game*/ /datum/admins/proc/toggleguests, /*toggles whether guests can join the current game*/ /datum/admins/proc/announce, /*priority announce something to all clients.*/