From ce5c7619b97c6bbd6f3a0e7fd42c13dfb3f37ba5 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Mon, 30 Apr 2018 15:39:48 -0400 Subject: [PATCH] Fix wonky PDA eject messages As reported in https://github.com/VOREStation/VOREStation/issues/3611, attempting to eject a cart on a PDA when there's no cart tells you that you can't do that while you're restrained, which isn't very explanatory. --- code/game/objects/items/devices/PDA/PDA.dm | 29 +++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 78ee749ceb..25d3d42d70 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -1247,19 +1247,24 @@ var/global/list/obj/item/device/pda/PDAs = list() if(issilicon(usr)) return - if(can_use(usr) && !isnull(cartridge)) - cartridge.forceMove(get_turf(src)) - if(ismob(loc)) - var/mob/M = loc - M.put_in_hands(cartridge) - mode = 0 - scanmode = 0 - if (cartridge.radio) - cartridge.radio.hostpda = null - to_chat(usr, "You remove \the [cartridge] from the [name].") - cartridge = null - else + if(!can_use(usr)) to_chat(usr, "You cannot do this while restrained.") + return + + if(isnull(cartridge)) + to_chat(usr, "There's no cartridge to eject.") + return + + cartridge.forceMove(get_turf(src)) + if(ismob(loc)) + var/mob/M = loc + M.put_in_hands(cartridge) + mode = 0 + scanmode = 0 + if (cartridge.radio) + cartridge.radio.hostpda = null + to_chat(usr, "You remove \the [cartridge] from the [name].") + cartridge = null /obj/item/device/pda/proc/id_check(mob/user as mob, choice as num)//To check for IDs; 1 for in-pda use, 2 for out of pda use. if(choice == 1)