Bugfix: ignore tanks with nil capacity
This commit is contained in:
parent
a9fc99b947
commit
a4bbd1cd2c
@ -232,8 +232,8 @@ var importFOB = func (ofp) {
|
|||||||
amount = math.min(amount, maxAmount);
|
amount = math.min(amount, maxAmount);
|
||||||
}
|
}
|
||||||
var tankCapacity =
|
var tankCapacity =
|
||||||
tankNode.getNode('capacity-m3').getValue() *
|
(tankNode.getNode('capacity-m3').getValue() or 0) *
|
||||||
tankNode.getNode('density-kgpm3').getValue();
|
(tankNode.getNode('density-kgpm3').getValue() or 0);
|
||||||
amount = math.min(amount, tankCapacity);
|
amount = math.min(amount, tankCapacity);
|
||||||
logprint(3, sprintf("Allocating %1.1f/%1.1f kg to %s", amount, unallocated, tankName));
|
logprint(3, sprintf("Allocating %1.1f/%1.1f kg to %s", amount, unallocated, tankName));
|
||||||
tankNode.getNode('level-kg').setValue(amount);
|
tankNode.getNode('level-kg').setValue(amount);
|
||||||
|
Loading…
Reference in New Issue
Block a user