From 6d2646239e70d46e993d08492da43c4583c4e519 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Tue, 25 Jan 2011 22:58:50 +0100 Subject: [PATCH] Fix wrong difference calculation in SGExpression --- simgear/structure/SGExpression.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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::getNumOperands(); - for (unsigned i = 0; i < sz; ++i) + for (unsigned i = 1; i < sz; ++i) value -= getOperand(i)->getValue(b); } using SGNaryExpression::getValue; -- 2.39.5