From a2c9d93aecab8e9da7075a3bc58c89ad309fea03 Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Sat, 25 Jan 2025 19:16:20 +1100 Subject: [PATCH] Passing thrown datum through end_throw(). --- code/controllers/subsystems/throwing.dm | 6 +++--- code/game/atoms_movable.dm | 2 +- code/game/objects/items/__item.dm | 2 +- code/modules/mob_holder/_holder.dm | 15 +++++++++------ 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/code/controllers/subsystems/throwing.dm b/code/controllers/subsystems/throwing.dm index 4dc2001e17e..0849837efd8 100644 --- a/code/controllers/subsystems/throwing.dm +++ b/code/controllers/subsystems/throwing.dm @@ -33,7 +33,7 @@ SUBSYSTEM_DEF(throwing) continue if (QDELETED(TT)) if(!QDELETED(AM)) - AM.end_throw() + AM.end_throw(TT) processing -= AM if (MC_TICK_CHECK) return @@ -103,7 +103,7 @@ SUBSYSTEM_DEF(throwing) /datum/thrownthing/Destroy() SSthrowing.processing -= thrownthing - thrownthing.end_throw() + thrownthing.end_throw(src) thrownthing = null target = null thrower = null @@ -192,7 +192,7 @@ SUBSYSTEM_DEF(throwing) if(!QDELETED(thrownthing)) thrownthing.fall() - thrownthing.end_throw() + thrownthing.end_throw(src) qdel(src) /datum/thrownthing/proc/hit_atom(atom/A) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 9c481be8d46..6092d7c6f42 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -566,7 +566,7 @@ appearance_flags &= ~remove_flags return old_appearance != appearance_flags -/atom/movable/proc/end_throw() +/atom/movable/proc/end_throw(datum/thrownthing/TT) throwing = null /atom/movable/proc/reset_movement_delay() diff --git a/code/game/objects/items/__item.dm b/code/game/objects/items/__item.dm index 4c117c1333d..6e90ec5083c 100644 --- a/code/game/objects/items/__item.dm +++ b/code/game/objects/items/__item.dm @@ -507,7 +507,7 @@ return TRUE return ..() -/obj/item/end_throw() +/obj/item/end_throw(datum/thrownthing/TT) . = ..() squash_item() diff --git a/code/modules/mob_holder/_holder.dm b/code/modules/mob_holder/_holder.dm index 002814c0c09..18a1f358dd9 100644 --- a/code/modules/mob_holder/_holder.dm +++ b/code/modules/mob_holder/_holder.dm @@ -46,7 +46,8 @@ icon = initial(icon) /obj/item/holder/Exited(atom/movable/am, atom/new_loc) - am.vis_flags = initial(am.vis_flags) + if(!(locate(/mob) in contents)) + am.vis_flags = initial(am.vis_flags) . = ..() /obj/item/holder/proc/destroy_all() @@ -72,15 +73,15 @@ update_state() /obj/item/holder/dropped() - ..() + . = ..() update_state(1) /obj/item/holder/throw_impact(atom/hit_atom, datum/thrownthing/TT) - ..() + . = ..() update_state(1) /obj/item/holder/proc/update_state(var/delay) - set waitfor = 0 + set waitfor = FALSE for(var/mob/M in contents) unregister_all_movement(last_holder, M) @@ -97,11 +98,13 @@ mob_container.dropInto(loc) M.reset_view() qdel(src) - else if(last_holder != loc) + return + + if(last_holder != loc) for(var/mob/M in contents) register_all_movement(loc, M) update_icon() - last_holder = loc + last_holder = loc /obj/item/holder/onDropInto(var/atom/movable/AM) if(ismob(loc)) // Bypass our holding mob and drop directly to its loc