diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 244209cc255..e7f2fd5daa3 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1319,19 +1319,23 @@ if (!ismob(loc)) return ..() - var/mob/M = loc - var/hand_index = M.get_held_index_of_item(src) + var/mob/owner = loc + var/hand_index = owner.get_held_index_of_item(src) if(!hand_index) return ..() - M.held_items[hand_index] = null - M.update_held_items() - if(M.client) - M.client.screen -= src + owner.held_items[hand_index] = null + owner.update_held_items() + if(owner.client) + owner.client.screen -= src + if(owner.observers?.len) + for(var/mob/dead/observe as anything in owner.observers) + if(observe.client) + observe.client.screen -= src layer = initial(layer) SET_PLANE_IMPLICIT(src, initial(plane)) appearance_flags &= ~NO_CLIENT_COLOR - dropped(M, FALSE) + dropped(owner, FALSE) return ..() /obj/item/proc/canStrip(mob/stripper, mob/owner) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 1ccc7af641f..db5bb011fd3 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -380,18 +380,28 @@ if(hand_index) held_items[hand_index] = null update_held_items() - if(I) - if(client) - client.screen -= I - I.layer = initial(I.layer) - SET_PLANE_EXPLICIT(I, initial(I.plane), newloc) - I.appearance_flags &= ~NO_CLIENT_COLOR - if(!no_move && !(I.item_flags & DROPDEL)) //item may be moved/qdel'd immedietely, don't bother moving it - if (isnull(newloc)) - I.moveToNullspace() - else - I.forceMove(newloc) - I.dropped(src, silent) + + if(!I) + return FALSE + + if(client) + client.screen -= I + + if(observers?.len) + for(var/mob/dead/observe as anything in observers) + if(observe.client) + observe.client.screen -= I + + I.layer = initial(I.layer) + SET_PLANE_EXPLICIT(I, initial(I.plane), newloc) + I.appearance_flags &= ~NO_CLIENT_COLOR + if(!no_move && !(I.item_flags & DROPDEL)) //item may be moved/qdel'd immedietely, don't bother moving it + if (isnull(newloc)) + I.moveToNullspace() + else + I.forceMove(newloc) + + I.dropped(src, silent) SEND_SIGNAL(I, COMSIG_ITEM_POST_UNEQUIP, force, newloc, no_move, invdrop, silent) SEND_SIGNAL(src, COMSIG_MOB_UNEQUIPPED_ITEM, I, force, newloc, no_move, invdrop, silent) return TRUE