diff --git a/code/datums/components/plumbing/filter.dm b/code/datums/components/plumbing/filter.dm index 55647a353b..76b76323c5 100644 --- a/code/datums/components/plumbing/filter.dm +++ b/code/datums/components/plumbing/filter.dm @@ -35,12 +35,12 @@ else for(var/A in reagents.reagent_list) var/datum/reagent/R = A - if(!can_give_in_direction(direction, R)) + if(!can_give_in_direction(direction, R.type)) continue var/new_amount if(R.volume < amount) new_amount = amount - R.volume - reagents.trans_id_to(target.parent, R, amount) + reagents.trans_id_to(target.parent, R.type, amount) amount = new_amount if(amount <= 0) break diff --git a/code/datums/components/plumbing/reaction_chamber.dm b/code/datums/components/plumbing/reaction_chamber.dm index 705611ed1a..3345eb0e76 100644 --- a/code/datums/components/plumbing/reaction_chamber.dm +++ b/code/datums/components/plumbing/reaction_chamber.dm @@ -7,7 +7,7 @@ if(!istype(parent, /obj/machinery/plumbing/reaction_chamber)) return COMPONENT_INCOMPATIBLE -/datum/component/plumbing/reaction_chamber/can_give(amount, reagent) +/datum/component/plumbing/reaction_chamber/can_give(amount, reagent, datum/ductnet/net) . = ..() var/obj/machinery/plumbing/reaction_chamber/RC = parent if(!. || !RC.emptying) @@ -21,7 +21,7 @@ var/has_reagent = FALSE for(var/A in reagents.reagent_list) var/datum/reagent/RD = A - if(RT == RD) + if(RT == RD.type) has_reagent = TRUE if(RD.volume < RC.required_reagents[RT]) process_request(min(RC.required_reagents[RT] - RD.volume, MACHINE_REAGENT_TRANSFER) , RT, dir) @@ -30,14 +30,9 @@ process_request(min(RC.required_reagents[RT], MACHINE_REAGENT_TRANSFER), RT, dir) return - RC.reagent_flags &= ~NO_REACT + reagents.flags &= ~NO_REACT reagents.handle_reactions() - if(reagents.fermiIsReacting) - return - RC.emptying = TRUE -/datum/component/plumbing/reaction_chamber/can_give(amount, reagent, datum/ductnet/net) - . = ..() - var/obj/machinery/plumbing/reaction_chamber/RC = parent - if(!. || !RC.emptying) - return FALSE + RC.emptying = TRUE //If we move this up, it'll instantly get turned off since any reaction always sets the reagent_total to zero. Other option is make the reaction update + //everything for every chemical removed, wich isn't a good option either. + RC.on_reagent_change() //We need to check it now, because some reactions leave nothing left. diff --git a/code/modules/plumbing/plumbers/filter.dm b/code/modules/plumbing/plumbers/filter.dm index b748c576e7..1ffd170507 100644 --- a/code/modules/plumbing/plumbers/filter.dm +++ b/code/modules/plumbing/plumbers/filter.dm @@ -4,6 +4,7 @@ desc = "A chemical filter for filtering chemicals. The left and right outputs appear to be from the perspective of the input port." icon_state = "filter" density = FALSE + ///whitelist of chems id's that go to the left side. Empty to disable port var/list/left = list() ///whitelist of chem id's that go to the right side. Empty to disable port @@ -12,21 +13,11 @@ var/list/english_left = list() ///whitelist of chems but their name instead of path var/list/english_right = list() - ui_x = 320 - ui_y = 310 - /obj/machinery/plumbing/filter/Initialize(mapload, bolt) . = ..() AddComponent(/datum/component/plumbing/filter, bolt) -/obj/machinery/plumbing/filter/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) - ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) - - if(!ui) - ui = new(user, src, ui_key, "chemical_filter", name, ui_x, ui_y, master_ui, state) - ui.open() - /obj/machinery/plumbing/filter/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) if(!ui) diff --git a/code/modules/plumbing/plumbers/reaction_chamber.dm b/code/modules/plumbing/plumbers/reaction_chamber.dm index 33fc5c8f0c..949543c300 100644 --- a/code/modules/plumbing/plumbers/reaction_chamber.dm +++ b/code/modules/plumbing/plumbers/reaction_chamber.dm @@ -3,9 +3,9 @@ name = "reaction chamber" desc = "Keeps chemicals seperated until given conditions are met." icon_state = "reaction_chamber" - buffer = 200 reagent_flags = TRANSPARENT | NO_REACT + /**list of set reagents that the reaction_chamber allows in, and must all be present before mixing is enabled. * example: list(/datum/reagent/water = 20, /datum/reagent/fuel/oil = 50) */