mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 11:28:03 +07:00
Resolved crash for mods with no eras defined
This commit is contained in:
parent
1f2ea971e5
commit
5223caf390
@ -505,13 +505,15 @@ class DiplomacyManager() {
|
|||||||
revertToZero(DiplomaticModifiers.DeclarationOfFriendship, 1 / 2f) //decreases slowly and will revert to full if it is declared later
|
revertToZero(DiplomaticModifiers.DeclarationOfFriendship, 1 / 2f) //decreases slowly and will revert to full if it is declared later
|
||||||
|
|
||||||
if (otherCiv().isCityState()) {
|
if (otherCiv().isCityState()) {
|
||||||
val eraInfo = civInfo.getEraObject()
|
|
||||||
|
|
||||||
if (relationshipLevel() < RelationshipLevel.Friend) {
|
if (relationshipLevel() < RelationshipLevel.Friend) {
|
||||||
if (hasFlag(DiplomacyFlags.ProvideMilitaryUnit)) removeFlag(DiplomacyFlags.ProvideMilitaryUnit)
|
if (hasFlag(DiplomacyFlags.ProvideMilitaryUnit)) removeFlag(DiplomacyFlags.ProvideMilitaryUnit)
|
||||||
} else {
|
} else {
|
||||||
val relevantBonuses = if (relationshipLevel() == RelationshipLevel.Friend) eraInfo.friendBonus[otherCiv().cityStateType.name]
|
val relevantBonuses = if (civInfo.gameInfo.ruleSet.eras.isEmpty()) null
|
||||||
else eraInfo.allyBonus[otherCiv().cityStateType.name]
|
else {
|
||||||
|
val eraInfo = civInfo.getEraObject()
|
||||||
|
if (relationshipLevel() == RelationshipLevel.Friend) eraInfo.friendBonus[otherCiv().cityStateType.name]
|
||||||
|
else eraInfo.allyBonus[otherCiv().cityStateType.name]
|
||||||
|
}
|
||||||
if (relevantBonuses == null && otherCiv().cityStateType == CityStateType.Militaristic) {
|
if (relevantBonuses == null && otherCiv().cityStateType == CityStateType.Militaristic) {
|
||||||
// Deprecated, assume Civ V values for compatibility
|
// Deprecated, assume Civ V values for compatibility
|
||||||
if (!hasFlag(DiplomacyFlags.ProvideMilitaryUnit) && relationshipLevel() == RelationshipLevel.Friend)
|
if (!hasFlag(DiplomacyFlags.ProvideMilitaryUnit) && relationshipLevel() == RelationshipLevel.Friend)
|
||||||
|
Loading…
Reference in New Issue
Block a user