From b052919d90edfee06d9d015f7c0ea1433f30d415 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 21 Feb 2023 06:08:21 +0100 Subject: [PATCH] [MIRROR] Fix paperplanes unfolding into different hand; balloon alerts [MDB IGNORE] (#19468) * Fix paperplanes unfolding into different hand; balloon alerts (#73522) :cl: coiax fix: Paper planes when unfolded will put the paper in your active hand, rather than a different hand, just like cardboard boxes. /:cl: - Also, use balloon alerts for folded/unfolded to match boxes ## Why It's Good For The Game Generally when you transform items from one form into another while having them in your hand, they generally go into the same hand. Also, people like balloon alerts now for these sorts of very minor transformations. * Fix paperplanes unfolding into different hand; balloon alerts --------- Co-authored-by: Jack Edge --- code/modules/paperwork/paperplane.dm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm index 09b4d9bfdc3..afdea61c52e 100644 --- a/code/modules/paperwork/paperplane.dm +++ b/code/modules/paperwork/paperplane.dm @@ -72,12 +72,16 @@ . += "paperplane_[stamp]" /obj/item/paperplane/attack_self(mob/user) - to_chat(user, span_notice("You unfold [src].")) - // We don't have to qdel the paperplane here; it shall be done once the internal paper object is moved out of src anyway. - if(user.Adjacent(internalPaper)) - user.put_in_hands(internalPaper) - else - internalPaper.forceMove(loc) + balloon_alert(user, "unfolded") + + var/atom/location = drop_location() + // Need to keep a reference to the internal paper + // when we move it out of the plane, our ref gets set to null + var/obj/item/paper/internal_paper = internalPaper + internal_paper.forceMove(location) + // This will as a side effect, qdel the paper plane, making the user's hands empty + + user.put_in_hands(internal_paper) /obj/item/paperplane/attackby(obj/item/P, mob/living/carbon/human/user, params) if(burn_paper_product_attackby_check(P, user)) @@ -160,7 +164,7 @@ * * obj/item/paperplane/plane_type - what it will be folded into (path) */ /obj/item/paper/proc/make_plane(mob/living/user, obj/item/I, obj/item/paperplane/plane_type = /obj/item/paperplane) - to_chat(user, span_notice("You fold [src] into the shape of a plane!")) + balloon_alert(user, "folded into a plane") user.temporarilyRemoveItemFromInventory(src) I = new plane_type(loc, src) if(user.Adjacent(I))