several bugfixes (#7577)

This commit is contained in:
Timothy Teakettle
2026-05-15 19:31:46 +02:00
committed by GitHub
parent edbe9fbf5f
commit 0e3eef37c8
11 changed files with 27 additions and 16 deletions
@@ -1,5 +1,6 @@
/datum/chemical_reaction/paint
abstract_type = /datum/chemical_reaction/paint
has_data_semantics = TRUE
var/result_color
/datum/chemical_reaction/paint/compute_result_data_initializer(datum/reagent_holder/holder, multiplier)
@@ -46,9 +46,9 @@
var/total_volume = old_volume + new_volume
var/old_hex = uppertext(old_data || "#ffffff")
var/new_hex = uppertext(new_data || "#ffffff")
return rgb(
((hex2num(copytext(old_hex, 2, 4)) * old_volume) + (hex2num(copytext(new_hex, 2, 4)))) / total_volume,
((hex2num(copytext(old_hex, 4, 6)) * old_volume) + (hex2num(copytext(new_hex, 4, 6)))) / total_volume,
((hex2num(copytext(old_hex, 6, 8)) * old_volume) + (hex2num(copytext(new_hex, 6, 8)))) / total_volume,
((hex2num(length(old_hex) > 7 ? copytext(old_hex, 8, 10) : 255) * old_volume) + (hex2num(length(new_hex) > 7 ? copytext(new_hex, 8, 10) : 255))) / total_volume,
((hex2num(copytext(old_hex, 6, 8)) * old_volume) + (hex2num(copytext(new_hex, 6, 8)))) / total_volume
)