mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-22 10:54:19 -04:00
getFlag returns 0 and does not crash if the flag does is not set
This commit is contained in:
parent
29d5b8375f
commit
237e286d4d
@ -543,7 +543,8 @@ class DiplomacyManager() : IsPartOfGameInfoSerialization {
|
||||
flagsCountdown[flag.name] = amount
|
||||
}
|
||||
|
||||
@Readonly fun getFlag(flag: DiplomacyFlags) = flagsCountdown[flag.name]!!
|
||||
/** 0 indicates 'flag does not exist' */
|
||||
@Readonly fun getFlag(flag: DiplomacyFlags) = flagsCountdown[flag.name] ?: 0
|
||||
fun removeFlag(flag: DiplomacyFlags) {
|
||||
flagsCountdown.remove(flag.name)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user