-Added a check for anchored items for spiders to caccoon.

-Removed some copy and pasted code.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5529 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2013-01-12 17:56:12 +00:00
parent adfe165840
commit b4d15e55e1
2 changed files with 7 additions and 29 deletions

View File

@@ -138,39 +138,16 @@
//fourthly, cocoon any nearby items so those pesky pinkskins can't use them
for(var/obj/O in can_see)
if(istype(O, /obj/item))
var/obj/item/I = O
cocoon_target = I
busy = MOVING_TO_TARGET
stop_automated_movement = 1
walk_to(src, I, 1, move_to_delay)
//give up if we can't reach them after 10 seconds
GiveUp(I)
return
if(O.anchored)
continue
if(istype(O, /obj/structure))
var/obj/structure/S = O
if(S.anchored)
continue
cocoon_target = S
if(istype(O, /obj/item) || istype(O, /obj/structure) || istype(O, /obj/machinery))
cocoon_target = O
busy = MOVING_TO_TARGET
stop_automated_movement = 1
walk_to(src, S, 1, move_to_delay)
walk_to(src, O, 1, move_to_delay)
//give up if we can't reach them after 10 seconds
GiveUp(S)
return
if(istype(O, /obj/machinery))
var/obj/machinery/M = O
if(M.anchored)
continue
cocoon_target = M
busy = MOVING_TO_TARGET
stop_automated_movement = 1
walk_to(src, M, 1, move_to_delay)
//give up if we can't reach them after 10 seconds
GiveUp(M)
return
GiveUp(O)
else if(busy == MOVING_TO_TARGET && cocoon_target)
if(get_dist(src, cocoon_target) <= 1)