Skip to content

Commit 537ee14

Browse files
committed
fixed other bug in the plugin dice roll engine
1 parent e6a0fef commit 537ee14

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

core/client/util/dicerollentry.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ DiceRollResult DiceRollEntry::roll(bool signOnPositive) const
6767
int sum = 0;
6868
for(int i=0;i<numDice_;i++)
6969
{
70-
int rolledValue = static_cast<int>(Dice::roll(value_));
71-
rollList.append(QString::number(rolledValue));
70+
int rolledValue = static_cast<int>(Dice::roll(std::abs(value_)));
71+
if(value_ < 0)
72+
rolledValue = - rolledValue;
73+
rollList.append(QString::number(std::abs(rolledValue)));
7274
sum += rolledValue;
7375
}
7476
text += rollList.join(',');

0 commit comments

Comments
 (0)