fixed antidrop and give

This commit is contained in:
joep van der velden
2019-03-24 18:27:03 +01:00
parent c2a2c1c4ce
commit 465166d46d
3 changed files with 22 additions and 8 deletions
+8
View File
@@ -33,10 +33,18 @@
to_chat(usr, "<span class='warning'> You need to stay in reaching distance while giving an object.</span>")
to_chat(target, "<span class='warning'> [usr.name] moved too far away.</span>")
return
if((I.flags & NODROP) || (I.flags & ABSTRACT))
to_chat(usr, "<span class='warning'>\the [I.name] stays stuck to your hand when you try to give it!</span>")
to_chat(target, "<span class='warning'>\the [I.name] stays stuck to [usr.name]'s hand when you try to take it!</span>")
return
if((usr.hand && usr.l_hand != I) || (!usr.hand && usr.r_hand != I))
to_chat(usr, "<span class='warning'> You need to keep the item in your active hand.</span>")
to_chat(target, "<span class='warning'> [usr.name] seem to have given up on giving \the [I.name] to you.</span>")
return
if(target.resting)
to_chat(usr, "<span class='warning'> They are resting and can't accept \the [I.name].</span>")
to_chat(target, "<span class='warning'> You can't can't accept \the [I.name] while resting.</span>")
return
if(target.r_hand != null && target.l_hand != null)
to_chat(target, "<span class='warning'> Your hands are full.</span>")
to_chat(usr, "<span class='warning'> Their hands are full.</span>")
@@ -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
+12 -6
View File
@@ -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, "<span class='warning'>You can't put \the [what.name] on [who], it's stuck to your hand!</span>")
return
if(what)
if(what.flags & NODROP)
to_chat(src, "<span class='warning'>You can't put \the [what.name] on [who], it's stuck to your hand!</span>")
return
if(!what.mob_can_equip(who, where, 1))
if(isliving(who))
var/mob/living/L = who
if(L.resting)
to_chat(src, "<span class='warning'>[who.name] can't hold \the [what.name] while resting.</span>")
return
to_chat(src, "<span class='warning'>\The [what.name] doesn't fit in that place!</span>")
return
if(!silent)
visible_message("<span class='notice'>[src] tries to put [what] on [who].</span>")
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()