mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-14 12:00:12 +07:00
Avoided more badly-defined-mod crashes
This commit is contained in:
parent
64fc57e6d2
commit
250d7debb5
@ -251,6 +251,8 @@ class Ruleset {
|
||||
lines += "${building.name} requires resource ${building.requiredResource} which does not exist!"
|
||||
if (building.replaces != null && !buildings.containsKey(building.replaces!!))
|
||||
lines += "${building.name} replaces ${building.replaces} which does not exist!"
|
||||
if (building.requiredTech == null && building.cost == 0)
|
||||
lines += "${building.name} must either have an explicit cost or reference an existing tech!"
|
||||
}
|
||||
|
||||
for (resource in tileResources.values) {
|
||||
|
@ -272,7 +272,7 @@ object ImageGetter {
|
||||
fun getResourceImage(resourceName: String, size:Float): Actor {
|
||||
val iconGroup = getImage("ResourceIcons/$resourceName").surroundWithCircle(size)
|
||||
val resource = ruleset.tileResources[resourceName]
|
||||
if (resource == null) throw Exception("No resource $resourceName found in ruleset!")
|
||||
if (resource == null) return iconGroup // This is the result of a bad modding setup, just give em an empty circle. Their problem.
|
||||
iconGroup.circle.color = getColorFromStats(resource)
|
||||
|
||||
if (resource.resourceType == ResourceType.Luxury) {
|
||||
|
Loading…
Reference in New Issue
Block a user