Make it work with nameless tanks

This commit is contained in:
Tobias Dammers 2021-09-22 23:07:20 +02:00
parent 0a86a3cc3b
commit 8f7eacaeee
2 changed files with 7 additions and 4 deletions

4
README
View File

@ -61,7 +61,11 @@ Supported Aircraft Types (as per 09/2021)
+------------------------+-----+---------+----------+-----------+---------+------+
| Citation-II | yes | yes | yes | yes | yes | yes |
+------------------------+-----+---------+----------+-----------+---------+------+
| Citation X | yes | yes | yes | yes | yes | yes |
+------------------------+-----+---------+----------+-----------+---------+------+
| CRJ700-family | yes | yes | yes | yes | yes | yes |
+------------------------+-----+---------+----------+-----------+---------+------+
| QSeries | yes | yes | yes | yes | no | yes |
+------------------------+-----+---------+----------+-----------+---------+------+
| DHC6 | yes | yes | yes | yes | yes | yes |
+------------------------+-----+---------+----------+-----------+---------+------+

View File

@ -216,11 +216,10 @@ var importFOB = func (ofp) {
return;
}
var tankNameNode = tankNode.getNode('name');
if (tankNameNode == nil) {
printf("Tank #%i not installed", tankNumber);
return;
var tankName = sprintf("Tank #%i", tankNumber);
if (tankNameNode != nil) {
tankName = tankNameNode.getValue() or tankName;
}
var tankName = tankNameNode.getValue();
var amount = unallocated;
if (maxAmount != nil) {
amount = math.min(amount, maxAmount);