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:
Aura Dusklight
2025-11-17 01:34:32 +02:00
committed by GitHub
parent 4851fcbb27
commit 32b2f30e68
3 changed files with 38 additions and 18 deletions
@@ -134,22 +134,31 @@
if(!reagents.total_volume) // Empty
activate_pin(3)
return
if(AM.can_be_injected_by(src))
if(isliving(AM))
var/mob/living/L = AM
var/turf/T = get_turf(AM)
T.visible_message(span_warning("[src] is trying to inject [L]!"))
sleep(3 SECONDS)
if(!L.can_be_injected_by(src))
activate_pin(3)
return
var/contained = reagents.get_reagents()
var/trans = reagents.trans_to_mob(L, transfer_amount, CHEM_BLOOD)
message_admins("[src] injected \the [L] with [trans]u of [contained].")
to_chat(AM, span_notice("You feel a tiny prick!"))
visible_message(span_warning("[src] injects [L]!"))
else
reagents.trans_to(AM, transfer_amount)
// Handle injections using the helper, same as the syringe.
if(isliving(AM))
var/mob/living/L = AM
if(!L.can_inject(null, 1)) // error_msg = 1 to show errors
activate_pin(3)
return
var/turf/T = get_turf(AM)
T.visible_message(span_warning("[src] is trying to inject [L]!"))
sleep(3 SECONDS)
if(!L.can_inject(null, 0)) // No error message on second check
activate_pin(3)
return
var/contained = reagents.get_reagents()
var/trans = reagents.trans_to_mob(L, transfer_amount, CHEM_BLOOD)
message_admins("[src] injected \the [L] with [trans]u of [contained].")
to_chat(AM, span_notice("You feel a tiny prick!"))
visible_message(span_warning("[src] injects [L]!"))
else
// Use standardized injection compatibility for objects
if(!AM.can_be_injected_by(src))
activate_pin(3)
return
reagents.trans_to(AM, transfer_amount)
else
if(reagents.total_volume >= volume) // Full