Natural wonders (and other terrains with no RGB) now have a golden color on the minimap

This commit is contained in:
Yair Morgenstern 2019-12-19 17:45:20 +02:00
parent e0171ef97a
commit ebfd79636f

View file

@ -2,8 +2,8 @@ package com.unciv.models.ruleset.tile
import com.badlogic.gdx.graphics.Color
import com.unciv.models.ruleset.Ruleset
import com.unciv.models.translations.tr
import com.unciv.models.stats.NamedStats
import com.unciv.models.translations.tr
import com.unciv.ui.utils.colorFromRGB
class Terrain : NamedStats() {
@ -61,5 +61,8 @@ class Terrain : NamedStats() {
var impassable = false
var rough = false
fun getColor(): Color = colorFromRGB(RGB!![0], RGB!![1], RGB!![2])
fun getColor(): Color {
if (RGB == null) return Color.GOLD
return colorFromRGB(RGB!![0], RGB!![1], RGB!![2])
}
}