Skip to content
Browse files

Fixes dice rolls so that bonuses only apply at the end of a roll.

  • Loading branch information...
1 parent cbc36c5 commit a4083f5ac7fe97dfef3bb98c7bb0f4181aa6e87d @wilkie wilkie committed Feb 22, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/xombot/plugins/dice.rb
View
7 lib/xombot/plugins/dice.rb
@@ -30,11 +30,12 @@ def roll(m, repeats, rolls, sides, offset_op, offset)
repeats.times do
rolls.times do
score = rand(sides.to_i) + 1
- if offset_op
- score = score.send(offset_op, offset.to_i)
- end
total += score
end
+
+ if offset_op
+ total = total.send(offset_op, offset.to_i)
+ end
end
m.reply "dice roll was: #{total}", true

0 comments on commit a4083f5

Please sign in to comment.
Something went wrong with that request. Please try again.