Merge pull request #13900 from Cameron653/syringe_overlay

Fixes an oversight with syringes.
This commit is contained in:
Casey
2022-10-16 17:02:52 -04:00
committed by CHOMPStation2
parent e2d375214d
commit 0ec934b863

View File

@@ -85,7 +85,7 @@
//Allow for capped syringes //Allow for capped syringes
/obj/item/weapon/reagent_containers/syringe/update_icon() /obj/item/weapon/reagent_containers/syringe/update_icon()
cut_overlays(src) cut_overlays()
var/matrix/tf = matrix() var/matrix/tf = matrix()
if(isstorage(loc)) if(isstorage(loc))
@@ -101,12 +101,11 @@
icon_state = "capped" icon_state = "capped"
return return
var/list/new_overlays = list()
var/rounded_vol = round(reagents.total_volume, round(reagents.maximum_volume / 3)) var/rounded_vol = round(reagents.total_volume, round(reagents.maximum_volume / 3))
if(reagents.total_volume) if(reagents.total_volume)
filling = image(icon, src, "filler[rounded_vol]") filling = image(icon, src, "filler[rounded_vol]")
filling.color = reagents.get_color() filling.color = reagents.get_color()
new_overlays += filling add_overlay(filling)
if(ismob(loc)) if(ismob(loc))
var/injoverlay var/injoverlay
@@ -115,9 +114,8 @@
injoverlay = "draw" injoverlay = "draw"
if (SYRINGE_INJECT) if (SYRINGE_INJECT)
injoverlay = "inject" injoverlay = "inject"
new_overlays += injoverlay add_overlay(injoverlay)
add_overlay(new_overlays)
icon_state = "[rounded_vol]" icon_state = "[rounded_vol]"
item_state = "syringe_[rounded_vol]" item_state = "syringe_[rounded_vol]"