From 548d8071a7bf1cb80cfd272fdc3c032334e52a57 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Fri, 28 Apr 2017 10:07:38 +0200 Subject: add support for arithmetic operator --- result/diceresult.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'result') diff --git a/result/diceresult.cpp b/result/diceresult.cpp index 2825eec..08a3672 100644 --- a/result/diceresult.cpp +++ b/result/diceresult.cpp @@ -19,7 +19,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + #include "diceresult.h" +#include DiceResult::DiceResult() { @@ -105,20 +107,20 @@ qreal DiceResult::getScalarResult() scalar-=tmp->getValue(); break; case Die::DIVIDE: - if(tmp!=0) + if(tmp->getValue()!=0) { scalar/=tmp->getValue(); } else { - //error(); + /// @todo Error cant divide by 0. Must be displayed. } break; } } else { - scalar=tmp; + scalar=tmp->getValue(); } ++i; } -- cgit v1.2.3-70-g09d2