From: Torsten Dreyer <Torsten@t3r.de>
Date: Tue, 25 Jan 2011 21:58:50 +0000 (+0100)
Subject: Fix wrong difference calculation in SGExpression
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6d2646239e70d46e993d08492da43c4583c4e519;p=simgear.git

Fix wrong difference calculation in SGExpression
---

diff --git a/simgear/structure/SGExpression.hxx b/simgear/structure/SGExpression.hxx
index 6f90061c..ffb9dd1d 100644
--- a/simgear/structure/SGExpression.hxx
+++ b/simgear/structure/SGExpression.hxx
@@ -807,9 +807,9 @@ public:
   { }
   virtual void eval(T& value, const simgear::expression::Binding* b) const
   {
-    value = T(0);
+    value = getOperand(0)->getValue(b);
     unsigned sz = SGNaryExpression<T>::getNumOperands();
-    for (unsigned i = 0; i < sz; ++i)
+    for (unsigned i = 1; i < sz; ++i)
       value -= getOperand(i)->getValue(b);
   }
   using SGNaryExpression<T>::getValue;