diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index 473715367b4..60ee4d94558 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -33,10 +33,18 @@ to_chat(usr, " You need to stay in reaching distance while giving an object.") to_chat(target, " [usr.name] moved too far away.") return + if((I.flags & NODROP) || (I.flags & ABSTRACT)) + to_chat(usr, "\the [I.name] stays stuck to your hand when you try to give it!") + to_chat(target, "\the [I.name] stays stuck to [usr.name]'s hand when you try to take it!") + return if((usr.hand && usr.l_hand != I) || (!usr.hand && usr.r_hand != I)) to_chat(usr, " You need to keep the item in your active hand.") to_chat(target, " [usr.name] seem to have given up on giving \the [I.name] to you.") return + if(target.resting) + to_chat(usr, " They are resting and can't accept \the [I.name].") + to_chat(target, " You can't can't accept \the [I.name] while resting.") + return if(target.r_hand != null && target.l_hand != null) to_chat(target, " Your hands are full.") to_chat(usr, " Their hands are full.") diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 7d83c7eaa1d..8d4ed90cada 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -434,11 +434,11 @@ if(slot_l_hand) if(l_hand) return 0 - return 1 + return !resting if(slot_r_hand) if(r_hand) return 0 - return 1 + return !resting if(slot_wear_mask) if(wear_mask) return 0 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index bf933f568d4..0d077172e34 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -749,19 +749,25 @@ // Override if a certain mob should be behave differently when placing items (can't, for example) /mob/living/stripPanelEquip(obj/item/what, mob/who, where, var/silent = 0) what = get_active_hand() - if(what && (what.flags & NODROP)) - to_chat(src, "You can't put \the [what.name] on [who], it's stuck to your hand!") - return if(what) + if(what.flags & NODROP) + to_chat(src, "You can't put \the [what.name] on [who], it's stuck to your hand!") + return if(!what.mob_can_equip(who, where, 1)) + if(isliving(who)) + var/mob/living/L = who + if(L.resting) + to_chat(src, "[who.name] can't hold \the [what.name] while resting.") + return to_chat(src, "\The [what.name] doesn't fit in that place!") return if(!silent) visible_message("[src] tries to put [what] on [who].") if(do_mob(src, who, what.put_on_delay)) - if(what && Adjacent(who)) - unEquip(what) - who.equip_to_slot_if_possible(what, where, 0, 1) + if(what && Adjacent(who) && !(what.flags & NODROP)) + unEquip(what) + if(!who.equip_to_slot_if_possible(what, where, 0, 1)) + what.loc = who.loc add_attack_logs(src, who, "Equipped [what]") /mob/living/singularity_act()