mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] prevent connecting a hose to the same object (#11326)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b03be78fe5
commit
2f16bdff4b
@@ -33,6 +33,9 @@
|
||||
/obj/item/stack/hose/afterattack(var/atom/target, var/mob/living/user, proximity, params)
|
||||
if(!proximity)
|
||||
return
|
||||
if(in_use)
|
||||
to_chat(user, span_danger("You must choose which connector this hose will connect to before you can attach the hose to something else."))
|
||||
return
|
||||
|
||||
var/datum/component/hose_connector/REMB = remembered?.resolve()
|
||||
var/list/available_sockets = list()
|
||||
@@ -72,9 +75,11 @@
|
||||
to_chat(user, span_notice("You connect one end of tubing to \the [AC]."))
|
||||
|
||||
else
|
||||
in_use = TRUE // Prevent opening a million uis
|
||||
var/choice = tgui_input_list(user, "Select a target hose connector.", "Socket Selection", available_sockets)
|
||||
in_use = FALSE
|
||||
|
||||
if(choice)
|
||||
if(choice && user.Adjacent(target))
|
||||
var/datum/component/hose_connector/CC = available_sockets[choice]
|
||||
if(REMB)
|
||||
if(REMB.get_carrier() == CC.get_carrier())
|
||||
|
||||
Reference in New Issue
Block a user