diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 42fadf77cae..ee738f010d2 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -269,9 +269,9 @@ // At this point in client Click() code we have passed the 1/10 sec check and little else // We don't even know if it's a middle click if(!usr.canClick()) - return 1 - if(usr.stat || usr.paralysis || usr.stunned || usr.weakened) - return 1 + return TRUE + if(use_check_and_message(usr)) + return TRUE switch(name) if(BP_R_HAND) if(iscarbon(usr)) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index b367e22200e..10be9ae817a 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -424,7 +424,7 @@ var/global/list/obj/item/device/pda/PDAs = list() /obj/item/device/pda/MouseDrop(obj/over_object as obj, src_location, over_location) var/mob/M = usr - if((!istype(over_object, /obj/screen)) && !use_check(M)) + if(!istype(over_object, /obj/screen) && !use_check(M) && !(over_object == src)) return attack_self(M) /obj/item/device/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 6b916635139..e661edea23c 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -52,29 +52,29 @@ QDEL_NULL(closer) return ..() -/obj/item/storage/MouseDrop(obj/over_object as obj) - +/obj/item/storage/MouseDrop(obj/over_object) if(!canremove) return - - if (ishuman(usr) || issmall(usr)) //so monkeys can take off their backpacks -- Urist - + if(!over_object || over_object == src) + return + if(istype(over_object, /obj/screen/inventory)) + var/obj/screen/inventory/S = over_object + if(S.slot_id == src.equip_slot) + return + if(ishuman(usr) || issmall(usr)) //so monkeys can take off their backpacks -- Urist if(over_object == usr && Adjacent(usr)) // this must come before the screen objects only block src.open(usr) return - - if (!( istype(over_object, /obj/screen) )) + if(!(istype(over_object, /obj/screen))) return ..() //makes sure that the storage is equipped, so that we can't drag it into our hand from miles away. //there's got to be a better way of doing this. - if (!(src.loc == usr) || (src.loc && src.loc.loc == usr)) + if(!(src.loc == usr) || (src.loc && src.loc.loc == usr)) return - - if (( usr.restrained() ) || ( usr.stat )) + if(use_check_and_message(usr)) return - - if ((src.loc == usr) && !usr.unEquip(src)) + if((src.loc == usr) && !usr.unEquip(src)) return switch(over_object.name) @@ -86,7 +86,6 @@ usr.put_in_l_hand(src,FALSE) src.add_fingerprint(usr) - /obj/item/storage/proc/return_inv() . = contents.Copy() diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm index 3b64ca05926..b6796701ef4 100644 --- a/code/modules/clothing/clothing_accessories.dm +++ b/code/modules/clothing/clothing_accessories.dm @@ -40,22 +40,26 @@ return ..() /obj/item/clothing/MouseDrop(var/obj/over_object) - if (ishuman(usr) || issmall(usr)) + if(ishuman(usr) || issmall(usr)) //makes sure that the clothing is equipped so that we can't drag it into our hand from miles away. - if (!(src.loc == usr)) + if(!(src.loc == usr)) return - if(!over_object) + if(!over_object || over_object == src) return - if (( usr.restrained() ) || ( usr.stat )) + if(istype(over_object, /obj/screen/inventory)) + var/obj/screen/inventory/S = over_object + if(S.slot_id == src.equip_slot) + return + + if(use_check_and_message(usr)) return - if (!usr.canUnEquip(src)) + if(!usr.canUnEquip(src)) return var/obj/item/clothing/C = src - usr.unEquip(C) switch(over_object.name) diff --git a/html/changelogs/geeves-click_drag_QoL.yml b/html/changelogs/geeves-click_drag_QoL.yml new file mode 100644 index 00000000000..72a2f03a0e5 --- /dev/null +++ b/html/changelogs/geeves-click_drag_QoL.yml @@ -0,0 +1,7 @@ +author: Geeves + +delete-after: True + +changes: + - rscdel: "Dragging a PDA onto itself no longer opens its menu. Over PDA dragging actions still function as normal." + - tweak: "Dragging an item onto itself, or onto the slot it's equipped to, doesn't drop it to the floor anymore." \ No newline at end of file