mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-15 10:18:26 +07:00
Added ruleset check for units whose type is not defined in the unitTypes
This commit is contained in:
@ -369,7 +369,9 @@ class CivilizationInfo {
|
|||||||
otherCiv.addNotification(meetString, cityStateLocation, NotificationIcon.Gold)
|
otherCiv.addNotification(meetString, cityStateLocation, NotificationIcon.Gold)
|
||||||
else
|
else
|
||||||
otherCiv.addNotification(meetString, NotificationIcon.Gold)
|
otherCiv.addNotification(meetString, NotificationIcon.Gold)
|
||||||
otherCiv.addStats(giftAmount)
|
|
||||||
|
for (stat in giftAmount.toHashMap().filter { it.value != 0f })
|
||||||
|
otherCiv.addStat(stat.key, stat.value.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun discoverNaturalWonder(naturalWonderName: String) {
|
fun discoverNaturalWonder(naturalWonderName: String) {
|
||||||
|
@ -289,6 +289,7 @@ class Ruleset {
|
|||||||
fun isError() = status == CheckModLinksStatus.Error
|
fun isError() = status == CheckModLinksStatus.Error
|
||||||
fun isNotOK() = status != CheckModLinksStatus.OK
|
fun isNotOK() = status != CheckModLinksStatus.OK
|
||||||
}
|
}
|
||||||
|
|
||||||
fun checkModLinks(): CheckModLinksResult {
|
fun checkModLinks(): CheckModLinksResult {
|
||||||
val lines = ArrayList<String>()
|
val lines = ArrayList<String>()
|
||||||
var warningCount = 0
|
var warningCount = 0
|
||||||
@ -338,8 +339,9 @@ class Ruleset {
|
|||||||
lines += "${unit.name} replaces ${unit.replaces} which does not exist!"
|
lines += "${unit.name} replaces ${unit.replaces} which does not exist!"
|
||||||
for (promotion in unit.promotions)
|
for (promotion in unit.promotions)
|
||||||
if (!unitPromotions.containsKey(promotion))
|
if (!unitPromotions.containsKey(promotion))
|
||||||
lines += "${unit.replaces} contains promotion $promotion which does not exist!"
|
lines += "${unit.name} contains promotion $promotion which does not exist!"
|
||||||
|
if (!unitTypes.containsKey(unit.unitType))
|
||||||
|
lines += "${unit.name} is of type ${unit.unitType}, which does not exist!"
|
||||||
}
|
}
|
||||||
|
|
||||||
for (building in buildings.values) {
|
for (building in buildings.values) {
|
||||||
|
Reference in New Issue
Block a user