mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-28 06:28:01 +01:00
Fix hypo injector being unable to inject common injectables. (#18685)
* Fix integrated hypo injector being unable to inject common injectables. * Add helper for injection handling * call parent --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Kashargul
parent
4851fcbb27
commit
32b2f30e68
@@ -187,7 +187,7 @@
|
||||
if(istype(target, /obj/item/implantcase/chem))
|
||||
return
|
||||
|
||||
if(!target.is_open_container() && !ismob(target) && !istype(target, /obj/item/reagent_containers/food) && !istype(target, /obj/item/slime_extract) && !istype(target, /obj/item/clothing/mask/smokable/cigarette) && !istype(target, /obj/item/storage/fancy/cigarettes))
|
||||
if(!target.is_injectable_container() && !ismob(target))
|
||||
to_chat(user, span_notice("You cannot directly fill this object."))
|
||||
return
|
||||
if(!target.reagents.get_free_space())
|
||||
|
||||
@@ -8,7 +8,18 @@
|
||||
return TRUE
|
||||
|
||||
/obj/can_be_injected_by(var/atom/injector)
|
||||
return is_open_container() && ..()
|
||||
if(!..())
|
||||
return FALSE
|
||||
// Then check if this is a type of container that can be injected
|
||||
return is_injectable_container()
|
||||
|
||||
/mob/living/can_be_injected_by(var/atom/injector)
|
||||
return ..() && (can_inject(null, 0, BP_TORSO) || can_inject(null, 0, BP_GROIN))
|
||||
|
||||
// Helper for anything checking if it can inject a container like a syringe.
|
||||
/obj/proc/is_injectable_container()
|
||||
return is_open_container() || \
|
||||
istype(src, /obj/item/reagent_containers/food) || \
|
||||
istype(src, /obj/item/slime_extract) || \
|
||||
istype(src, /obj/item/clothing/mask/smokable/cigarette) || \
|
||||
istype(src, /obj/item/storage/fancy/cigarettes)
|
||||
|
||||
Reference in New Issue
Block a user