Skip to content

Commit

Permalink
Enforce injection amount too
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Feb 15, 2024
1 parent e2c78f1 commit a2aaa2c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/game/machinery/medical_pod/sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,14 @@
var/amount = text2num(params["amount"])
if(!length(chemical) || amount <= 0)
return
if(!(amount in connected.amounts))
log_debug("[amount] is an invalid amount to inject in [src]!")
return
if(!(chemical in connected.available_chemicals))
log_debug("[chemical] is not available to inject in [src]!")
return
if(connected.occupant.reagents && connected.occupant.reagents.get_reagent_amount(chemical) + amount > connected.max_chem)
return
if(connected.occupant.health > connected.min_health || (chemical in connected.emergency_chems))
connected.inject_chemical(usr, chemical, amount)
else
Expand Down

0 comments on commit a2aaa2c

Please sign in to comment.