Fix erroneous relationship decay notification (#7564)

Whenever your relationship resting point as well as the relationship
score for city states is at the exact value of 30 or 60, a notification
is shown that the relationship is about to degrade, even though it can
and will not.
This fixes said issue by changing the comparison operators of the
current influence and the resting point in
getCityStateInfluenceDegrade() and getCityStateInfluenceRecovery() to
the correct ones, respectively <= and >=.
This commit is contained in:
oynqr 2022-08-01 14:57:58 +00:00 committed by GitHub
parent 6a943bb46f
commit 6054b32f92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,7 +260,7 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
}
private fun getCityStateInfluenceDegrade(): Float {
if (getInfluence() < getCityStateInfluenceRestingPoint())
if (getInfluence() <= getCityStateInfluenceRestingPoint())
return 0f
val decrement = when {
@ -288,7 +288,7 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
}
private fun getCityStateInfluenceRecovery(): Float {
if (getInfluence() > getCityStateInfluenceRestingPoint())
if (getInfluence() >= getCityStateInfluenceRestingPoint())
return 0f
val increment = 1f // sic: personality does not matter here