Merge pull request #3472 from Menshin/missing_nodrop

Nodrop  checks for several machines/structures
This commit is contained in:
Miauw62
2014-05-03 15:44:26 +02:00
12 changed files with 52 additions and 17 deletions
+9 -3
View File
@@ -540,8 +540,10 @@
if(src.SUIT)
user << "<font color='blue'>The unit already contains a suit.</font>"
return
if(!user.drop_item())
user << "<span class='notice'>\The [S] is stuck to your hand, you cannot put it in the Suit Storage Unit!</span>"
return
user << "You load the [S.name] into the storage compartment."
user.drop_item()
S.loc = src
src.SUIT = S
src.update_icon()
@@ -554,8 +556,10 @@
if(src.HELMET)
user << "<font color='blue'>The unit already contains a helmet.</font>"
return
if(!user.drop_item())
user << "<span class='notice'>\The [H] is stuck to your hand, you cannot put it in the Suit Storage Unit!</span>"
return
user << "You load the [H.name] into the storage compartment."
user.drop_item()
H.loc = src
src.HELMET = H
src.update_icon()
@@ -568,8 +572,10 @@
if(src.MASK)
user << "<font color='blue'>The unit already contains a mask.</font>"
return
if(!user.drop_item())
user << "<span class='notice'>\The [M] is stuck to your hand, you cannot put it in the Suit Storage Unit!</span>"
return
user << "You load the [M.name] into the storage compartment."
user.drop_item()
M.loc = src
src.MASK = M
src.update_icon()
+3
View File
@@ -256,6 +256,9 @@
if ( istype(W,/obj/item/clothing/head/helmet ) )
user << "This item does not fit."
return
if(W.flags & NODROP) //if "can't drop" item
user << "<span class='notice'>\The [W] is stuck to your hand, you cannot put it in the washing machine!</span>"
return
if(contents.len < 5)
if ( state in list(1, 3) )
+3 -1
View File
@@ -190,7 +190,9 @@ LINEN BINS
user << "<span class='notice'>You put [I] in [src].</span>"
update_icon()
else if(amount && !hidden && I.w_class < 4) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
user.drop_item()
if(!user.drop_item())
user << "<span class='notice'>\The [I] is stuck to your hand, you cannot hide it among the sheets!</span>"
return
I.loc = src
hidden = I
user << "<span class='notice'>You hide [I] among the sheets.</span>"
@@ -250,7 +250,6 @@
if(contents.len >= storage_capacity)
return -1
if(include_mobs && isliving(AM))
var/mob/living/L = AM
if(L.buckled)
@@ -325,7 +324,9 @@
if(opened)
if(isrobot(user))
return
user.drop_item()
if(!user.drop_item()) //couldn't drop the item
user << "<span class='notice'>\The [W] is stuck to your hand, you cannot put it in \the [src]!</span>"
return
if(W)
W.loc = src.loc
else if(istype(W, /obj/item/weapon/packageWrap))
+3 -1
View File
@@ -146,7 +146,9 @@ FLOOR SAFES
if(open)
if(I.w_class + space <= maxspace)
space += I.w_class
user.drop_item()
if(!user.drop_item())
user << "<span class='notice'>\The [I] is stuck to your hand, you cannot put it in the safe!</span>"
return
I.loc = src
user << "<span class='notice'>You put [I] in [src].</span>"
updateUsrDialog()
+6 -2
View File
@@ -708,7 +708,9 @@ Destroy type values:
return
if(isrobot(user))
return
user.drop_item()
if(!user.drop_item())
user << "<span class='notice'>\The [O] is stuck to your hand, you cannot put it in the rack!</span>"
return
if (O.loc != src.loc)
step(O, get_dir(O, src))
return
@@ -722,7 +724,9 @@ Destroy type values:
if(isrobot(user))
return
user.drop_item()
if(!user.drop_item())
user << "<span class='notice'>\The [W] is stuck to your hand, you cannot put it in the rack!</span>"
return
if(W && W.loc) W.loc = src.loc
return 1
+3 -1
View File
@@ -89,7 +89,9 @@
if(w_items + I.w_class > 5)
user << "<span class='notice'>The cistern is full.</span>"
return
user.drop_item()
if(!user.drop_item())
user << "<span class='notice'>\The [I] is stuck to your hand, you cannot put it in the cistern!</span>"
return
I.loc = src
w_items += I.w_class
user << "<span class='notice'>You carefully place [I] into the cistern.</span>"
+4 -1
View File
@@ -70,7 +70,10 @@ obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob
user << "<span class='notice'>There are no seeds in \the [O.name].</span>"
return
user.drop_item()
if(!user.drop_item()) //couldn't drop the item
user << "<span class='notice'>\The [O] is stuck to your hand, you cannot put it in the seed extractor!</span>"
return
if(O && O.loc)
O.loc = src.loc
+3 -1
View File
@@ -210,7 +210,9 @@
if(carved)
if(!store)
if(I.w_class < 3)
user.drop_item()
if(!user.drop_item())
user << "<span class='notice'>\The [I] is stuck to your hand, you cannot put it in [title]!</span>"
return
I.loc = src
store = I
user << "<span class='notice'>You put [I] in [title].</span>"
@@ -144,7 +144,9 @@
if( ! ( item_to_add.type in allowed_types ) )
usr << "You set [item_to_add] on [src]'s back, but \he shakes it off!"
usr.drop_item()
if(!usr.drop_item())
usr << "<span class='notice'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s back!</span>"
return
item_to_add.loc = loc
if(prob(25))
step_rand(item_to_add)
@@ -305,17 +307,21 @@
if(valid)
if(usr)
if(!usr.drop_item())
usr << "<span class='notice'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!</span>"
return 0
usr.visible_message("[usr] puts [item_to_add] on [real_name]'s head. [src] looks at [usr] and barks once.",
"You put [item_to_add] on [real_name]'s head. [src] gives you a peculiar look, then wags \his tail once and barks.",
"You hear a friendly-sounding bark.")
usr.drop_item()
item_to_add.loc = src
src.inventory_head = item_to_add
regenerate_icons()
else
if(!usr.drop_item())
usr << "<span class='notice'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!</span>"
return 0
usr << "You set [item_to_add] on [src]'s head, but \he shakes it off!"
usr.drop_item()
item_to_add.loc = loc
if(prob(25))
step_rand(item_to_add)
+3 -1
View File
@@ -117,7 +117,9 @@
// attack with item, place item on conveyor
/obj/machinery/conveyor/attackby(var/obj/item/I, mob/user)
if(isrobot(user)) return //Carn: fix for borgs dropping their modules on conveyor belts
user.drop_item()
if(!user.drop_item())
user << "<span class='notice'>\The [I] is stuck to your hand, you cannot place it on the conveyor!</span>"
return
if(I && I.loc) I.loc = src.loc
return
@@ -69,9 +69,11 @@ Note: Must be placed within 3 tiles of the R&D Console
if (temp_tech.len == 0)
user << "<span class='warning'> You cannot deconstruct this item!</span>"
return
if(!user.drop_item())
user << "<span class='notice'>\The [O] is stuck to your hand, you cannot put it in the analyzer!</span>"
return
busy = 1
loaded_item = O
user.drop_item()
O.loc = src
user << "<span class='notice'>You add the [O.name] to the machine!</span>"
flick("d_analyzer_la", src)