mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 21:11:35 +07:00
Avoid crashes with incorrect condtionals (#9753)
This commit is contained in:
parent
fdb07b06c1
commit
d2dac66f40
@ -44,8 +44,10 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
|
||||
|
||||
fun hasTriggerConditional(): Boolean {
|
||||
if(conditionals.none()) return false
|
||||
return conditionals.any{ conditional -> conditional.type!!.targetTypes
|
||||
.any{ it.canAcceptUniqueTarget(UniqueTarget.TriggerCondition) } }
|
||||
return conditionals.any{ conditional -> conditional.type?.targetTypes
|
||||
?.any{ it.canAcceptUniqueTarget(UniqueTarget.TriggerCondition) }
|
||||
?: false
|
||||
}
|
||||
}
|
||||
|
||||
fun isOfType(uniqueType: UniqueType) = uniqueType == type
|
||||
|
Loading…
Reference in New Issue
Block a user