diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index bf534e43b02..fe68af16cec 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -119,11 +119,9 @@ RestrainedClickOn(A) return 1 - if(in_throw_mode) - if(isturf(A) || isturf(A.loc)) - throw_item(A) - return 1 + if(in_throw_mode && (isturf(A) || isturf(A.loc)) && throw_item(A)) throw_mode_off() + return TRUE var/obj/item/W = get_active_hand() diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index f41357fd6d0..9caf728e481 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -328,19 +328,15 @@ var/list/slot_equipment_priority = list( \ //Throwing stuff /mob/proc/throw_item(atom/target) - return + return FALSE /mob/living/carbon/throw_item(atom/target) - src.throw_mode_off() - if(stat || !target) - return - if(target.type == /obj/screen) - return + if(stat || !target || istype(target, /obj/screen)) + return FALSE var/atom/movable/item = src.get_active_hand() - if(!item) - return + return FALSE if(istype(item, /obj/item/grab)) var/obj/item/grab/G = item @@ -354,7 +350,7 @@ var/list/slot_equipment_priority = list( \ to_chat(src, "You gently let go of [M].") src.remove_from_mob(item) item.loc = src.loc - return + return TRUE var/start_T_descriptor = "tile at [start_T.x], [start_T.y], [start_T.z] in area [get_area(start_T)]" var/end_T_descriptor = "tile at [end_T.x], [end_T.y], [end_T.z] in area [get_area(end_T)]" @@ -364,10 +360,10 @@ var/list/slot_equipment_priority = list( \ qdel(G) else - return + return FALSE if(!item) - return //Grab processing has a chance of returning null + return FALSE //Grab processing has a chance of returning null if(a_intent == I_HELP && Adjacent(target) && isitem(item)) var/obj/item/I = item @@ -381,17 +377,17 @@ var/list/slot_equipment_priority = list( \ else to_chat(src, SPAN_NOTICE("You offer \the [I] to \the [target].")) do_give(H) - return + return TRUE remove_from_mob(I) make_item_drop_sound(I) I.forceMove(get_turf(target)) - return + return TRUE remove_from_mob(item) if(is_pacified()) to_chat(src, "You set [item] down gently on the ground.") - return + return TRUE //actually throw it! if(item) @@ -408,6 +404,9 @@ var/list/slot_equipment_priority = list( \ playsound(src, 'sound/effects/throw.ogg', volume, TRUE, -1) item.throw_at(target, item.throw_range, item.throw_speed, src) + return TRUE + + return FALSE /mob/proc/delete_inventory(var/include_carried = FALSE) for(var/entry in get_equipped_items(include_carried)) diff --git a/html/changelogs/geeves-throwmode_qol.yml b/html/changelogs/geeves-throwmode_qol.yml new file mode 100644 index 00000000000..78742a1fa21 --- /dev/null +++ b/html/changelogs/geeves-throwmode_qol.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Throw mode no longer blocks clicks and will only block your click and toggle off throw mode if it succesfully does an item throwing action." \ No newline at end of file