From 81fc15d8e733c4ccb9e71b5e56e36ab3bc0bb4c0 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Mon, 12 Aug 2019 08:50:20 +0100 Subject: [PATCH] Nasal/view.nas: fix for regression in handling of /sim/current-view/?-offset-m. resetViewPos(): set /sim/current-view/?-offset-m to /sim/view[]/config/?-offset-m, not zeros. This requires corresponding change to flightgear to compensate for the extra offset, and fixes things when aircraft implement custom views by writing to /sim/current-view/?-offset-m. --- Nasal/view.nas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Nasal/view.nas b/Nasal/view.nas index c8209f080..f6f5a6f3d 100644 --- a/Nasal/view.nas +++ b/Nasal/view.nas @@ -114,9 +114,9 @@ var resetFOV = func { var resetViewPos = func { var v = current.getNode("config"); - setprop("/sim/current-view/x-offset-m", 0); - setprop("/sim/current-view/y-offset-m", 0); - setprop("/sim/current-view/z-offset-m", 0); + setprop("/sim/current-view/x-offset-m", v.getNode("x-offset-m", 1).getValue() or 0); + setprop("/sim/current-view/y-offset-m", v.getNode("y-offset-m", 1).getValue() or 0); + setprop("/sim/current-view/z-offset-m", v.getNode("z-offset-m", 1).getValue() or 0); } var resetViewDir = func {