Avoid font-related crash

This commit is contained in:
Yair Morgenstern
2023-04-19 11:26:11 +03:00
parent 2f25ed3053
commit 4d63f0542f
3 changed files with 7 additions and 6 deletions

View File

@ -452,7 +452,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
CarryAirUnits("Can carry [amount] [mapUnitFilter] units", UniqueTarget.Unit),
CarryExtraAirUnits("Can carry [amount] extra [mapUnitFilter] units", UniqueTarget.Unit),
CannotBeCarriedBy("Cannot be carried by [mapUnitFilter] units", UniqueTarget.Unit),
// Interception
ChanceInterceptAirAttacks("[relativeAmount]% chance to intercept air attacks", UniqueTarget.Unit),
DamageFromInterceptionReduced("Damage taken from interception reduced by [relativeAmount]%", UniqueTarget.Unit),

View File

@ -160,8 +160,13 @@ class NativeBitmapFontData(
MayaCalendar.katun -> getPixmap(MayaCalendar.katunIcon)
MayaCalendar.baktun -> getPixmap(MayaCalendar.baktunIcon)
in MayaCalendar.digits -> getPixmap(MayaCalendar.digitIcon(ch))
in Fonts.charToRulesetImageActor -> Fonts.getPixmapFromActor(
Fonts.charToRulesetImageActor[ch]!!)
in Fonts.charToRulesetImageActor ->
try {
// This sometimes fails with a "Frame buffer couldn't be constructed: incomplete attachment" error, unclear why
Fonts.getPixmapFromActor(Fonts.charToRulesetImageActor[ch]!!)
} catch (ex: Exception) {
Pixmap(0,0, Pixmap.Format.RGBA8888) // Empty space
}
else -> fontImplementation.getCharPixmap(ch)
}
}

View File

@ -806,9 +806,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
??? example "Can only heal by pillaging"
Applicable to: Global, Unit
??? example "Normal vision when embarked"
Applicable to: Global, Unit
??? example "Defense bonus when embarked"
Applicable to: Global, Unit