From c656f910240c361da8a65ba15ae3bc448a5f5e33 Mon Sep 17 00:00:00 2001
From: MadmanMartian <30557196+MadmanMartian@users.noreply.github.com>
Date: Sun, 30 Sep 2018 01:21:30 +0100
Subject: [PATCH] Fixes nukes not actually ending the round (#19869)
---
code/datums/gamemode/gamemode.dm | 7 +---
code/datums/statistics/stat_helpers.dm | 2 +-
.../gamemodes/malfunction/Malf_Modules.dm | 9 +++--
code/game/gamemodes/nuclear/nuclearbomb.dm | 34 ++++---------------
4 files changed, 12 insertions(+), 40 deletions(-)
diff --git a/code/datums/gamemode/gamemode.dm b/code/datums/gamemode/gamemode.dm
index 68f45e57eeb..3bb5d3bab3b 100644
--- a/code/datums/gamemode/gamemode.dm
+++ b/code/datums/gamemode/gamemode.dm
@@ -25,11 +25,6 @@
var/list/orphaned_roles = list()
var/dat = ""
- //'Oh dear we accidentally destroyed the station/universe' variables
- var/station_was_nuked
- var/explosion_in_progress
-
-
/datum/gamemode/proc/can_start()
if(minimum_player_count && minimum_player_count < get_player_count())
return 0
@@ -246,7 +241,7 @@
for(var/datum/faction/F in factions)
if(F.check_win())
return 1
- if(emergency_shuttle.location==2 || station_was_nuked)
+ if(emergency_shuttle.location==2 || ticker.station_was_nuked)
return 1
return 0
diff --git a/code/datums/statistics/stat_helpers.dm b/code/datums/statistics/stat_helpers.dm
index a6dac0b5399..357605d7430 100644
--- a/code/datums/statistics/stat_helpers.dm
+++ b/code/datums/statistics/stat_helpers.dm
@@ -155,7 +155,7 @@
mapname = map.nameLong
mastermode = master_mode // this is stored as a string in game
tickermode = ticker.mode.name
- nuked = ticker.mode.station_was_nuked
+ nuked = ticker.station_was_nuked
tech_total = get_research_score()
stationname = station_name()
// if(istype(ticker.mode, /datum/game_mode/mixed))
diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm
index 264d76ef29a..73a86fa4571 100644
--- a/code/game/gamemodes/malfunction/Malf_Modules.dm
+++ b/code/game/gamemodes/malfunction/Malf_Modules.dm
@@ -497,7 +497,7 @@ rcd light flash thingy on matter drain
to_chat(usr, "You are unable to access the self-destruct system as you don't control the station yet.")
return 1
- if(ticker.mode.explosion_in_progress || ticker.mode.station_was_nuked)
+ if(ticker.explosion_in_progress || ticker.station_was_nuked)
to_chat(usr, "The self-destruct countdown was already triggered!")
return 1
@@ -517,7 +517,7 @@ rcd light flash thingy on matter drain
for(var/spell/S in AI.antag.current.spell_list)
if(istype(S,/spell/aoe_turf/ai_win))
AI.antag.current.remove_spell(S)
- ticker.mode.explosion_in_progress = 1
+ ticker.explosion_in_progress = 1
for(var/mob/MM in player_list)
if(MM.client)
MM << 'sound/machines/Alarm.ogg'
@@ -529,8 +529,7 @@ rcd light flash thingy on matter drain
enter_allowed = 0
if(ticker)
ticker.station_explosion_cinematic(0,null)
- if(ticker.mode)
- ticker.mode.station_was_nuked = 1
- ticker.mode.explosion_in_progress = 0
+ ticker.station_was_nuked = 1
+ ticker.explosion_in_progress = 0
return
diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm
index 98fe9784156..7528d223f69 100644
--- a/code/game/gamemodes/nuclear/nuclearbomb.dm
+++ b/code/game/gamemodes/nuclear/nuclearbomb.dm
@@ -288,35 +288,13 @@ var/obj/item/weapon/disk/nuclear/nukedisk
else
off_station = 2
forceMove(null)
- if(ticker)
- ticker.station_explosion_cinematic(off_station,null)
- if(ticker.mode)
- ticker.explosion_in_progress = 0
- to_chat(world, "The station was destroyed by the nuclear blast!")
+ ticker.station_explosion_cinematic(off_station,null)
+ ticker.explosion_in_progress = FALSE
+ to_chat(world, "The station was destroyed by the nuclear blast!")
- ticker.station_was_nuked = (off_station<2) //offstation==1 is a draw. the station becomes irradiated and needs to be evacuated.
- //kinda shit but I couldn't get permission to do what I wanted to do.
- stat_collection.nuked++
-
- if(!ticker.mode.check_finished())//If the mode does not deal with the nuke going off so just reboot because everyone is stuck as is
- to_chat(world, "Resetting in 30 seconds!")
-
- feedback_set_details("end_error","nuke - unhandled ending")
-
- if(blackbox)
- blackbox.save_all_data_to_sql()
-
- CallHook("Reboot",list())
-
- if (watchdog.waiting)
- to_chat(world, "Server will shut down for an automatic update in a few seconds.")
- watchdog.signal_ready()
- return
- sleep(300)
- log_game("Rebooting due to nuclear detonation")
- world.Reboot()
- return
- return
+ ticker.station_was_nuked = (off_station<2) //offstation==1 is a draw. the station becomes irradiated and needs to be evacuated.
+ //kinda shit but I couldn't get permission to do what I wanted to do.
+ stat_collection.nuked++
/obj/machinery/nuclearbomb/send_to_past(var/duration)
..()