Code review

This commit is contained in:
PlayeRom 2022-08-15 00:41:04 +02:00
parent 1f39ea2347
commit 4a8e1e4981
2 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,7 @@ var main = func(addon) {
loadExtraNasalFiles(addon);
setlistener("/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/ai-model", func(n) {
setlistener(addon.node.getPath() ~ "/addon-devel/ai-model", func(n) {
aerotow.startAerotow();
});
}

View File

@ -152,7 +152,7 @@ var isScenarioAdded = func () {
# Return name of selected aircraft. Possible values: "Cub", "DR400", "c182".
#
var getSelectedAircraft = func () {
return getprop("/addons/by-id/org.flightgear.addons.Aerotow/addon-devel/ai-model") or "Cub";
return getprop(addon.node.getPath() ~ "/addon-devel/ai-model") or "Cub";
}
#
@ -183,7 +183,7 @@ var generateFlightPlanXml = func () {
if (runway.length < minRwyLength) {
messages.displayError(
"This runway is too short. Please choose a longer one than " ~ minRwyLength ~ " m "
~ "(" ~ math.round(minRwyLength * M2FT) ~ " ft)."
~ "(" ~ math.round(minRwyLength * globals.M2FT) ~ " ft)."
);
return 0;
}
@ -335,7 +335,7 @@ var initAircraftVariable = func (airport, runway, isGliderPos = 1) {
# Set AI airplane altitude as glider altitude (assumed it's on the ground).
# It is more accurate than airport.elevation.
g_altitude = gliderCoord.alt() * M2FT;
g_altitude = gliderCoord.alt() * globals.M2FT;
}
#