From 1fd1271c8fd640c18ebae3938f922016d29fd3e2 Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Sun, 4 Sep 2022 23:05:00 -0400 Subject: [PATCH] Fixes ghost role / admin events announcing after they failed to spawn the antagonist. Admin spawned blobs will no longer announce immediately. (#69671) * Fixes ghost role / admin events announcing after they failed to spawn the antagonist. * Actually, this isn't even needed --- code/modules/events/blob.dm | 2 ++ code/modules/events/ghost_role.dm | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/code/modules/events/blob.dm b/code/modules/events/blob.dm index fc56c8001eb..9ca4fa9b05e 100644 --- a/code/modules/events/blob.dm +++ b/code/modules/events/blob.dm @@ -22,6 +22,8 @@ fakeable = TRUE /datum/round_event/ghost_role/blob/announce(fake) + if(!fake) + return //the mob itself handles this. priority_announce("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", ANNOUNCER_OUTBREAK5) /datum/round_event/ghost_role/blob/spawn_role() diff --git a/code/modules/events/ghost_role.dm b/code/modules/events/ghost_role.dm index 0c4e8bd9787..eb1b3b768f1 100644 --- a/code/modules/events/ghost_role.dm +++ b/code/modules/events/ghost_role.dm @@ -8,6 +8,7 @@ var/role_name = "debug rat with cancer" // Q U A L I T Y M E M E S var/list/spawned_mobs = list() var/status + var/cached_announcement_chance fakeable = FALSE /datum/round_event/ghost_role/start() @@ -19,6 +20,9 @@ processing = FALSE status = spawn_role() + if(isnull(cached_announcement_chance)) + cached_announcement_chance = announce_chance //only announce once we've finished the spawning loop. + announce_chance = (status == SUCCESSFUL_SPAWN ? cached_announcement_chance : 0) if((status == WAITING_FOR_SOMETHING)) if(retry >= MAX_SPAWN_ATTEMPT) message_admins("[role_name] event has exceeded maximum spawn attempts. Aborting and refunding.")