tweak: Better stacks (#21861)

* tweak: Better stacks

* review changes

* del return

* that's it
This commit is contained in:
Aylong
2023-08-16 22:11:39 +03:00
committed by GitHub
parent d00dddc589
commit ceea2c54e5
2 changed files with 6 additions and 4 deletions
+5 -4
View File
@@ -55,11 +55,12 @@
. = ..()
if(!dynamic_icon_state)
return
var/temp_amount = get_amount()
if(temp_amount > 1)
icon_state = "[initial(icon_state)]_[min(temp_amount, 3)]" //2 if amount is 2, 3 if more.
var/state = CEILING((amount/max_amount) * 3, 1)
if(state <= 1)
icon_state = initial(icon_state)
return
icon_state = initial(icon_state)
icon_state = "[initial(icon_state)]_[state]"
/obj/item/stack/Crossed(obj/O, oldloc)
if(amount >= max_amount || ismob(loc)) // Prevents unnecessary call. Also prevents merging stack automatically in a mob's inventory