From 283b58e93df1ef10918daccbaa3eae788e5b538e Mon Sep 17 00:00:00 2001 From: Leshana Date: Thu, 9 Feb 2017 14:47:33 -0500 Subject: [PATCH] Fixes dragging clothing with storage onto an occupied hand * If you mouse-drag certain items onto a hand which is already holding something, the item goes into limbo. * The reason this happens is that the standard code handling drags is directly calling usr.u_equip, despite the comment on that proc clearly saying never to do that. So it just throws it to limbo and the next line attempting to put it in hand does nothing becuase the hand is occupied. Better way is to call unEquip, so the item will drop on the ground if it fails. * Fixes https://github.com/VOREStation/VOREStation/issues/394 --- code/game/objects/items/weapons/storage/internal.dm | 4 ++-- code/game/objects/items/weapons/storage/storage.dm | 4 ++-- code/modules/paperwork/clipboard.dm | 4 ++-- code/modules/paperwork/photography.dm | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm index b135c439b6..8d1898fe4b 100644 --- a/code/game/objects/items/weapons/storage/internal.dm +++ b/code/game/objects/items/weapons/storage/internal.dm @@ -50,10 +50,10 @@ if (!( user.restrained() ) && !( user.stat )) switch(over_object.name) if("r_hand") - user.u_equip(master_item) + user.unEquip(master_item) user.put_in_r_hand(master_item) if("l_hand") - user.u_equip(master_item) + user.unEquip(master_item) user.put_in_l_hand(master_item) master_item.add_fingerprint(user) return 0 diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 8c1c47713a..3846a44d2b 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -77,10 +77,10 @@ switch(over_object.name) if("r_hand") - usr.u_equip(src) + usr.unEquip(src) usr.put_in_r_hand(src) if("l_hand") - usr.u_equip(src) + usr.unEquip(src) usr.put_in_l_hand(src) src.add_fingerprint(usr) diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index ccb527986f..b0da801703 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -23,10 +23,10 @@ if(!M.restrained() && !M.stat) switch(over_object.name) if("r_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_r_hand(src) if("l_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_l_hand(src) add_fingerprint(usr) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index a0f81f0aee..19a7e0498d 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -98,10 +98,10 @@ var/global/photo_count = 0 if((!( M.restrained() ) && !( M.stat ) && M.back == src)) switch(over_object.name) if("r_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_r_hand(src) if("l_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_l_hand(src) add_fingerprint(usr) return