]> git.mxchange.org Git - simgear.git/commitdiff
Fix wrong difference calculation in SGExpression
authorTorsten Dreyer <Torsten@t3r.de>
Tue, 25 Jan 2011 21:58:50 +0000 (22:58 +0100)
committerTorsten Dreyer <Torsten@t3r.de>
Tue, 25 Jan 2011 21:58:50 +0000 (22:58 +0100)
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;