From 2f2bce12e5dad3806d11900e848cc8d292536965 Mon Sep 17 00:00:00 2001 From: "rastaf.zero@gmail.com" Date: Thu, 13 Jan 2011 09:01:40 +0000 Subject: [PATCH] Fixed megabomb bug. Signalers and timers now wont explode bomb after detaching. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@846 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/objects/assemblies.dm | 39 +++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/code/game/objects/assemblies.dm b/code/game/objects/assemblies.dm index 7b64ca0c3b8..22d5a38b912 100644 --- a/code/game/objects/assemblies.dm +++ b/code/game/objects/assemblies.dm @@ -69,10 +69,14 @@ return if (src.loc == usr) if(href_list["tankone"]) + split_gases() + valve_open = 0 tank_one.loc = get_turf(src) tank_one = null update_icon() if(href_list["tanktwo"]) + split_gases() + valve_open = 0 tank_two.loc = get_turf(src) tank_two = null update_icon() @@ -81,6 +85,7 @@ if(href_list["rem_device"]) if(attached_device) attached_device.loc = get_turf(src) + attached_device.master = null attached_device = null update_icon() if(href_list["device"]) @@ -133,7 +138,20 @@ //device_overlay.icon_state = device_icon src.overlays += K proc - + merge_gases() + tank_two.air_contents.volume += tank_one.air_contents.volume + var/datum/gas_mixture/temp + temp = tank_one.air_contents.remove_ratio(1) + tank_two.air_contents.merge(temp) + + split_gases() + if (!valve_open || !tank_one || !tank_two) + return + var/ratio1 = tank_one.air_contents.volume/tank_two.air_contents.volume + var/datum/gas_mixture/temp + temp = tank_two.air_contents.remove_ratio(ratio1) + tank_one.air_contents.merge(temp) + tank_two.air_contents.volume -= tank_one.air_contents.volume /* Exadv1: I know this isn't how it's going to work, but this was just to check @@ -141,22 +159,25 @@ */ toggle_valve() - src.valve_open = !valve_open - if(valve_open && (tank_one && tank_two)) + if(valve_open==0 && (tank_one && tank_two)) + valve_open = 1 var/turf/bombturf = get_turf(src) var/bombarea = bombturf.loc.name bombers += "Bomb valve opened in [bombarea] with device attacher: [attacher]. Last touched by: [src.fingerprintslast]" message_admins("Bomb valve opened in [bombarea] with device attacher: [attacher]. Last touched by: [src.fingerprintslast]") - var/datum/gas_mixture/temp - temp = tank_one.air_contents.remove_ratio(1) - - tank_two.air_contents.volume = tank_two.air_contents.volume + tank_one.air_contents.volume - tank_two.air_contents.merge(temp) + merge_gases() spawn(20) // In case one tank bursts + for (var/i=0,i<5,i++) + src.update_icon() + sleep(10) src.update_icon() - + + else if(valve_open==1 && (tank_one && tank_two)) + split_gases() + valve_open = 0 + src.update_icon() // this doesn't do anything but the timer etc. expects it to be here // eventually maybe have it update icon to show state (timer, prox etc.) like old bombs