From f8c6f0eb8a92e0025e9921df3cfbb92dfb407e92 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Sun, 8 Dec 2019 22:03:35 -0700 Subject: [PATCH] Update items.dm --- code/game/objects/items.dm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index c5d198c05f..b7f6ef550f 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -578,21 +578,22 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) itempush = 0 //too light to push anything return A.hitby(src, 0, itempush) -/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback) +/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, messy_throw = TRUE) thrownby = thrower - callback = CALLBACK(src, .proc/after_throw, callback) //replace their callback with our own + callback = CALLBACK(src, .proc/after_throw, callback, messy_throw) //replace their callback with our own . = ..(target, range, speed, thrower, spin, diagonals_first, callback) -/obj/item/proc/after_throw(datum/callback/callback) +/obj/item/proc/after_throw(datum/callback/callback, messy_throw) if (callback) //call the original callback . = callback.Invoke() throw_speed = initial(throw_speed) //explosions change this. item_flags &= ~IN_INVENTORY - var/matrix/M = matrix(transform) - M.Turn(rand(-170, 170)) - transform = M - pixel_x = rand(-8, 8) - pixel_y = rand(-8, 8) + if(messy_throw) + var/matrix/M = matrix(transform) + M.Turn(rand(-170, 170)) + transform = M + pixel_x = rand(-8, 8) + pixel_y = rand(-8, 8) /obj/item/proc/remove_item_from_storage(atom/newLoc) //please use this if you're going to snowflake an item out of a obj/item/storage if(!newLoc)