Skip to content

Commit

Permalink
fixes canisters not closing valve on eject (#6028)
Browse files Browse the repository at this point in the history
  • Loading branch information
silicons authored Oct 1, 2023
1 parent a33aaeb commit fd759bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
15 changes: 5 additions & 10 deletions code/modules/atmospherics/machinery/portable/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -425,18 +425,13 @@ update_flag
log_open()
valve_open = !valve_open
. = TRUE
if("eject")
if(holding)
if(valve_open)
valve_open = 0
release_log += "Valve was <b>closed</b> by [usr] ([usr.ckey]), stopping the transfer into the [holding]<br>"
if(istype(holding, /obj/item/tank))
holding.manipulated_by = usr.real_name
holding.loc = loc
holding = null
. = TRUE
update_appearance()

/obj/machinery/portable_atmospherics/canister/on_eject(obj/item/tank/tank, mob/user)
user.action_feedback(SPAN_WARNING("[src]'s valve closes automatically as you yank \the [tank] out. That was close."), src)
valve_open = FALSE
return ..()

/obj/machinery/portable_atmospherics/canister/phoron/Initialize(mapload)
. = ..()
src.air_contents.adjust_gas(GAS_ID_PHORON, MolesForPressure())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,18 @@
if("eject")
if(isnull(holding))
return TRUE
on_eject(holding, usr)
usr.action_feedback(SPAN_NOTICE("You remove [holding] from [src]."), src)
usr.grab_item_from_interacted_with(holding, src)
holding = null
return TRUE

/**
* Called on tank ejection
*/
/obj/machinery/portable_atmospherics/proc/on_eject(obj/item/tank/tank, mob/user)
return TRUE

/obj/machinery/portable_atmospherics/proc/set_on(enabled)
on = enabled
update_icon()
Expand Down

0 comments on commit fd759bd

Please sign in to comment.