diff options
| author | 2017-04-28 10:07:38 +0200 | |
|---|---|---|
| committer | 2017-04-28 10:07:38 +0200 | |
| commit | 548d8071a7bf1cb80cfd272fdc3c032334e52a57 (patch) | |
| tree | eac0788e10502af6cfc9696336150e900ed5c676 /result | |
| parent | 237754b8c2c8828545f2c8295d911a0b11e58e1c (diff) | |
| download | OneRoll-548d8071a7bf1cb80cfd272fdc3c032334e52a57.tar.gz OneRoll-548d8071a7bf1cb80cfd272fdc3c032334e52a57.zip | |
add support for arithmetic operator
Diffstat (limited to 'result')
| -rw-r--r-- | result/diceresult.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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 <QDebug> 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; } |