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-II | yes | yes | yes | yes | yes | yes |
+------------------------+-----+---------+----------+-----------+---------+------+ +------------------------+-----+---------+----------+-----------+---------+------+
| Citation X | yes | yes | yes | yes | yes | yes |
+------------------------+-----+---------+----------+-----------+---------+------+
| CRJ700-family | yes | yes | yes | yes | yes | yes | | CRJ700-family | yes | yes | yes | yes | yes | yes |
+------------------------+-----+---------+----------+-----------+---------+------+ +------------------------+-----+---------+----------+-----------+---------+------+
| QSeries | yes | yes | yes | yes | no | 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; return;
} }
var tankNameNode = tankNode.getNode('name'); var tankNameNode = tankNode.getNode('name');
if (tankNameNode == nil) { var tankName = sprintf("Tank #%i", tankNumber);
printf("Tank #%i not installed", tankNumber); if (tankNameNode != nil) {
return; tankName = tankNameNode.getValue() or tankName;
} }
var tankName = tankNameNode.getValue();
var amount = unallocated; var amount = unallocated;
if (maxAmount != nil) { if (maxAmount != nil) {
amount = math.min(amount, maxAmount); amount = math.min(amount, maxAmount);