Fixed a few bugs with IV drips.

This commit is contained in:
cib
2012-10-15 18:01:31 +02:00
parent 338d1bebb4
commit a577c0bfac
2 changed files with 13 additions and 7 deletions

View File

@@ -1,6 +1,8 @@
/obj/machinery/iv_drip
name = "\improper IV drip"
icon = 'icons/obj/iv_drip.dmi'
anchored = 0
density = 1
/obj/machinery/iv_drip/var/mob/living/carbon/human/attached = null
/obj/machinery/iv_drip/var/obj/item/weapon/reagent_containers/beaker = null
@@ -35,7 +37,10 @@
..()
if(attached)
usr << "[attached] is already attached to the drip."
visible_message("[src.attached] is detached from \the [src]")
src.attached = null
src.update_icon()
return
if(in_range(src, usr) && ishuman(over_object) && get_dist(over_object, src) <= 1)
visible_message("[usr] attaches \the [src] to \the [over_object].")
@@ -62,6 +67,7 @@
/obj/machinery/iv_drip/process()
set background = 1
..()
if(src.attached && src.beaker && src.beaker.volume > 0)
if(!(get_dist(src, src.attached) <= 1))
visible_message("The needle is ripped out of [src.attached], doesn't that hurt?")
@@ -74,9 +80,8 @@
update_icon()
/obj/machinery/iv_drip/attack_hand(mob/user as mob)
if(src.attached)
visible_message("[src.attached] is detached from \the [src]")
src.attached = null
src.update_icon()
if(src.beaker)
src.beaker.loc = get_turf(src)
src.beaker = null
else
return ..()

View File

@@ -26,7 +26,8 @@
/obj/machinery/bot/medbot,
/obj/machinery/computer/pandemic,
/obj/item/weapon/secstorage/ssafe,
/obj/machinery/disposal
/obj/machinery/disposal,
/obj/machinery/iv_drip
)
examine()
@@ -222,4 +223,4 @@
..()
reagents.add_reagent("fluorosurfactant", 20)
*/
*/