mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-30 00:30:06 +01:00
Cleans up the storage accessory attackby path and prevents double insertion of items into storage accessories.
This commit is contained in:
@@ -26,14 +26,14 @@
|
||||
if(istype(I, /obj/item/clothing/accessory))
|
||||
var/obj/item/clothing/accessory/A = I
|
||||
if(attempt_attach_accessory(A, user))
|
||||
return
|
||||
|
||||
return TRUE
|
||||
if(LAZYLEN(accessories))
|
||||
for(var/obj/item/clothing/accessory/A in accessories)
|
||||
A.attackby(I, user)
|
||||
return
|
||||
|
||||
..()
|
||||
if(QDELETED(I) || I.loc != user)
|
||||
break
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/attack_hand(var/mob/user)
|
||||
//only forward to the attached accessory if the clothing is equipped (not in a storage)
|
||||
@@ -146,4 +146,4 @@
|
||||
if(LAZYLEN(accessories))
|
||||
for(var/obj/item/clothing/accessory/A in accessories)
|
||||
A.emp_act(severity)
|
||||
..()
|
||||
..()
|
||||
|
||||
@@ -20,8 +20,9 @@
|
||||
..(over_object)
|
||||
|
||||
/obj/item/clothing/suit/storage/attackby(obj/item/W as obj, mob/user as mob)
|
||||
..()
|
||||
pockets.attackby(W, user)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return pockets.attackby(W, user)
|
||||
|
||||
/obj/item/clothing/suit/storage/emp_act(severity)
|
||||
pockets.emp_act(severity)
|
||||
|
||||
@@ -97,10 +97,6 @@
|
||||
else if(get_turf(src)) //We actually exist in space
|
||||
forceMove(get_turf(src))
|
||||
|
||||
//default attackby behaviour
|
||||
/obj/item/clothing/accessory/attackby(obj/item/I, mob/user)
|
||||
..()
|
||||
|
||||
//default attack_hand behaviour
|
||||
/obj/item/clothing/accessory/attack_hand(mob/user as mob)
|
||||
if(has_suit)
|
||||
|
||||
@@ -34,8 +34,10 @@
|
||||
if (hold.handle_mousedrop(usr, over_object))
|
||||
..(over_object)
|
||||
|
||||
/obj/item/clothing/accessory/storage/attackby(obj/item/W as obj, mob/user as mob)
|
||||
return hold.attackby(W, user)
|
||||
/obj/item/clothing/accessory/storage/attackby(obj/item/W, mob/user)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return hold.attackby(W, user)
|
||||
|
||||
/obj/item/clothing/accessory/storage/emp_act(severity)
|
||||
hold.emp_act(severity)
|
||||
|
||||
@@ -1,38 +1,29 @@
|
||||
|
||||
/obj/attackby(var/obj/item/O, var/mob/user)
|
||||
. = ..()
|
||||
|
||||
if(locate(/obj/item/hose_connector) in src)
|
||||
if(O.is_wirecutter())
|
||||
var/list/available_sockets = list()
|
||||
|
||||
for(var/obj/item/hose_connector/HC in src)
|
||||
if(HC.my_hose)
|
||||
available_sockets |= HC
|
||||
|
||||
if(LAZYLEN(available_sockets))
|
||||
if(available_sockets.len == 1)
|
||||
var/obj/item/hose_connector/AC = available_sockets[1]
|
||||
var/choice = alert("Are you sure you want to disconnect [AC]?", "Confirm", "Yes", "No")
|
||||
|
||||
if(choice == "Yes" && Adjacent(user))
|
||||
visible_message("[user] disconnects \the hose from \the [src].")
|
||||
AC.my_hose.disconnect()
|
||||
return
|
||||
|
||||
if(O.is_wirecutter() && (locate(/obj/item/hose_connector) in src))
|
||||
var/list/available_sockets = list()
|
||||
for(var/obj/item/hose_connector/HC in src)
|
||||
if(HC.my_hose)
|
||||
available_sockets |= HC
|
||||
if(LAZYLEN(available_sockets))
|
||||
if(available_sockets.len == 1)
|
||||
var/obj/item/hose_connector/AC = available_sockets[1]
|
||||
var/choice = alert("Are you sure you want to disconnect [AC]?", "Confirm", "Yes", "No")
|
||||
if(choice == "Yes" && Adjacent(user))
|
||||
visible_message("[user] disconnects \the hose from \the [src].")
|
||||
AC.my_hose.disconnect()
|
||||
else
|
||||
|
||||
var/choice = input("Select a target hose connector.", "Socket Disconnect", null) as null|anything in available_sockets
|
||||
|
||||
if(choice)
|
||||
var/obj/item/hose_connector/AC = choice
|
||||
var/confirm = alert("Are you sure you want to disconnect [AC]?", "Confirm", "Yes", "No")
|
||||
|
||||
if(confirm == "Yes" && Adjacent(user))
|
||||
visible_message("[user] disconnects \the hose from \the [src].")
|
||||
AC.my_hose.disconnect()
|
||||
|
||||
return
|
||||
if(!choice || QDELETED(user) || QDELETED(O) || O.loc != user || user.incapacitated() || (loc != user && !user.Adjacent(src)))
|
||||
return TRUE
|
||||
var/obj/item/hose_connector/AC = choice
|
||||
var/confirm = alert("Are you sure you want to disconnect [AC]?", "Confirm", "Yes", "No")
|
||||
if(confirm == "No" || QDELETED(user) || QDELETED(O) || O.loc != user || user.incapacitated() || (loc != user && !user.Adjacent(src)))
|
||||
return TRUE
|
||||
visible_message("[user] disconnects \the hose from \the [src].")
|
||||
AC.my_hose.disconnect()
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/item/hose_connector
|
||||
name = "hose connector"
|
||||
|
||||
@@ -139,8 +139,9 @@
|
||||
new /obj/item/pickaxe/six_pick(src)
|
||||
|
||||
/obj/item/storage/excavation/handle_item_insertion()
|
||||
..()
|
||||
sort_picks()
|
||||
. = ..()
|
||||
if(.)
|
||||
sort_picks()
|
||||
|
||||
/obj/item/storage/excavation/proc/sort_picks()
|
||||
var/list/obj/item/pickaxe/picksToSort = list()
|
||||
|
||||
Reference in New Issue
Block a user