From 003eced6af6d11b4c5a93dae2681aaa1c960cb8b Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Wed, 9 May 2018 00:39:59 +0300 Subject: [PATCH] [s] Removes some stationloving-related failure surface (#37727) COMSIG_TRY_STORAGE_TAKE fails, leaving the disk out-of-bounds. forceMove HAS to be good enough here. --- code/datums/components/stationloving.dm | 8 +------- code/game/objects/items.dm | 15 +++++++++++++++ code/modules/mob/inventory.dm | 5 ++++- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/code/datums/components/stationloving.dm b/code/datums/components/stationloving.dm index a999624c32..54f8b107e0 100644 --- a/code/datums/components/stationloving.dm +++ b/code/datums/components/stationloving.dm @@ -28,13 +28,7 @@ CRASH("Unable to find a blobstart landmark") var/atom/movable/AM = parent - if(ismob(AM.loc)) - var/mob/M = AM.loc - M.transferItemToLoc(AM, targetturf, TRUE) //nodrops disks when? - else if(AM.loc.SendSignal(COMSIG_CONTAINS_STORAGE)) - AM.loc.SendSignal(COMSIG_TRY_STORAGE_TAKE, src, targetturf, TRUE) - else - AM.forceMove(targetturf) + AM.forceMove(targetturf) // move the disc, so ghosts remain orbiting it even if it's "destroyed" return targetturf diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 4e298032db..e5335049ec 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -766,3 +766,18 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) // Returns a numeric value for sorting items used as parts in machines, so they can be replaced by the rped /obj/item/proc/get_part_rating() return 0 + +/obj/item/doMove(atom/destination) + if (ismob(loc)) + var/mob/M = loc + var/hand_index = M.get_held_index_of_item(src) + if(hand_index) + M.held_items[hand_index] = null + M.update_inv_hands() + if(M.client) + M.client.screen -= src + layer = initial(layer) + plane = initial(plane) + appearance_flags &= ~NO_CLIENT_COLOR + dropped(M) + return ..() diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index a7b28dd658..48951e4cd3 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -326,7 +326,10 @@ I.plane = initial(I.plane) I.appearance_flags &= ~NO_CLIENT_COLOR if(!no_move && !(I.flags_1 & DROPDEL_1)) //item may be moved/qdel'd immedietely, don't bother moving it - I.forceMove(newloc) + if (isnull(newloc)) + I.moveToNullspace() + else + I.forceMove(newloc) I.dropped(src) return TRUE