From 4c245f81ccdf85fe91fc8aaece7cc76f111de93c Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Fri, 17 Aug 2012 09:28:44 +0000 Subject: [PATCH] - Fixes issue 415. The problem with the moving of the syndicate shuttle was a condition bomb_set, not being properly set in all cases, where a bomb was timing. I added the setter for the bomb_set variable in nuclearbomb/process(). So if at least ONE nuke is ticking it means the bomb is set. The bomb_set variable gets reset in the appropriate places now. The places are if either the safety is enabled again or if the timer is disabled. Enabling the safety now automatically stops the timer. The timer cannot be enabled without the safety being off. The condition that caused the bad result before this fix was if the timer was enabled before the safety was turned off. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4470 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/gamemodes/nuclear/nuclearbomb.dm | 9 +++++++++ code/game/syndicate_shuttle.dm | 1 + 2 files changed, 10 insertions(+) diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index d0ef7566a0..2cc2b14207 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -22,6 +22,7 @@ /obj/machinery/nuclearbomb/process() if (src.timing) + bomb_set = 1 //So long as there is one nuke timing, it means one nuke is armed. src.timeleft-- if (src.timeleft <= 0) explode() @@ -116,16 +117,24 @@ if (href_list["timer"]) if (src.timing == -1.0) return + if (src.safety) + usr << "\red The safety is still on." + return src.timing = !( src.timing ) if (src.timing) src.icon_state = "nuclearbomb2" if(!src.safety) bomb_set = 1//There can still be issues with this reseting when there are multiple bombs. Not a big deal tho for Nuke/N + else + bomb_set = 0 else src.icon_state = "nuclearbomb1" bomb_set = 0 if (href_list["safety"]) src.safety = !( src.safety ) + if(safety) + src.timing = 0 + bomb_set = 0 if (href_list["anchor"]) src.anchored = !( src.anchored ) src.add_fingerprint(usr) diff --git a/code/game/syndicate_shuttle.dm b/code/game/syndicate_shuttle.dm index 6b7ddcbe7f..8f3bd197a4 100644 --- a/code/game/syndicate_shuttle.dm +++ b/code/game/syndicate_shuttle.dm @@ -121,6 +121,7 @@ var/bomb_set = 1 syndicate_out_of_moves = 1 /proc/syndicate_can_move() + //world << "moving_to_station = [syndicate_station_moving_to_station]; moving_to_space = [syndicate_station_moving_to_space]; out_of_moves = [syndicate_out_of_moves]; bomb_set = [bomb_set]; " if(syndicate_station_moving_to_station || syndicate_station_moving_to_space) return 0 if(syndicate_out_of_moves) return 0 if(!bomb_set) return 0