From 1758bf8314c476363475e92ff969ad93d0a03070 Mon Sep 17 00:00:00 2001 From: Spamcat Date: Mon, 18 Mar 2013 19:54:03 +0400 Subject: [PATCH] Fixed spiderbots grabbing items out of reach. --- .../mob/living/simple_animal/friendly/spiderbot.dm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index 86aeae28538..9a01fc3ff87 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -315,11 +315,16 @@ var/obj/selection = input("Select an item.", "Pickup") in items + items.Cut() if(selection) - held_item = selection - selection.loc = src - visible_message("\blue [src] scoops up the [held_item]!", "\blue You grab the [held_item]!", "You hear a skittering noise and a clink.") - return held_item + for(var/obj/item/I in view(1, src)) + if(selection == I) + held_item = selection + selection.loc = src + visible_message("\blue [src] scoops up the [held_item]!", "\blue You grab the [held_item]!", "You hear a skittering noise and a clink.") + return held_item + else + src << "\red \The [selection] is too far away." src << "\red There is nothing of interest to take." return 0 \ No newline at end of file