Broaden cargo packed event condition coverage
This commit is contained in:
parent
3f2632e330
commit
0c4a90c16c
11 changed files with 434 additions and 23 deletions
|
|
@ -752,6 +752,22 @@ fn evaluate_record_conditions(
|
|||
return Ok(None);
|
||||
}
|
||||
}
|
||||
RuntimeCondition::CargoProductionSlotThreshold {
|
||||
slot,
|
||||
comparator,
|
||||
value,
|
||||
..
|
||||
} => {
|
||||
let actual = state
|
||||
.cargo_production_overrides
|
||||
.get(slot)
|
||||
.copied()
|
||||
.map(i64::from)
|
||||
.unwrap_or(0);
|
||||
if !compare_condition_value(actual, *comparator, *value) {
|
||||
return Ok(None);
|
||||
}
|
||||
}
|
||||
RuntimeCondition::CargoProductionTotalThreshold { comparator, value } => {
|
||||
let actual = state
|
||||
.cargo_production_overrides
|
||||
|
|
@ -2234,6 +2250,12 @@ mod tests {
|
|||
comparator: RuntimeConditionComparator::Eq,
|
||||
value: 175000,
|
||||
},
|
||||
RuntimeCondition::CargoProductionSlotThreshold {
|
||||
slot: 1,
|
||||
label: "Cargo Production Slot 1".to_string(),
|
||||
comparator: RuntimeConditionComparator::Eq,
|
||||
value: 125,
|
||||
},
|
||||
RuntimeCondition::CargoProductionTotalThreshold {
|
||||
comparator: RuntimeConditionComparator::Eq,
|
||||
value: 200,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue