]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/SGExpression.hxx
Fix wrong difference calculation in SGExpression
[simgear.git] / simgear / structure / SGExpression.hxx
index 6f90061c32e6b97ba1249c088656f4dc5219bdcd..ffb9dd1ded2408b43797160ab597e6820cb0fa9f 100644 (file)
@@ -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;