Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes canisters not closing valve on eject #6028

Merged
merged 2 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading