- 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
This commit is contained in:
baloh.matevz
2012-08-17 09:28:44 +00:00
parent 6b1a3e46a0
commit 4c245f81cc
2 changed files with 10 additions and 0 deletions

View File

@@ -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)