Skip to content

Commit

Permalink
Update canister icons when connected to a port (#43518)
Browse files Browse the repository at this point in the history
I found that when the valve of a canister was closed, the
.../canister/process_atmos proc would never reach its update_icon call.
I've fixed that by removing the early return and having a single
update_icon call at the end run when necessary.
  • Loading branch information
willox authored and SpaceManiac committed Apr 7, 2019
1 parent 67deb48 commit c06ec19
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions code/modules/atmospherics/machinery/portable/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -366,19 +366,19 @@
if(timing && valve_timer < world.time)
valve_open = !valve_open
timing = FALSE
if(!valve_open)
if(valve_open)
var/turf/T = get_turf(src)
pump.airs[1] = air_contents
pump.airs[2] = holding ? holding.air_contents : T.return_air()
pump.target_pressure = release_pressure

pump.process_atmos() // Pump gas.
if(!holding)
air_update_turf() // Update the environment if needed.
else
pump.airs[1] = null
pump.airs[2] = null
return

var/turf/T = get_turf(src)
pump.airs[1] = air_contents
pump.airs[2] = holding ? holding.air_contents : T.return_air()
pump.target_pressure = release_pressure

pump.process_atmos() // Pump gas.
if(!holding)
air_update_turf() // Update the environment if needed.
update_icon()

/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
Expand Down

0 comments on commit c06ec19

Please sign in to comment.