diff options
Diffstat (limited to 'modules/coins.py')
| -rw-r--r-- | modules/coins.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/coins.py b/modules/coins.py index 735d404d..efb60edd 100644 --- a/modules/coins.py +++ b/modules/coins.py @@ -188,9 +188,13 @@ class Module(object): event["stderr"].write("You can only send coins to users that " "have had coins before") return - target_user_coins = decimal.Decimal(target_user_coins) event["user"].set_setting("coins", str(new_user_coins)) + # get target_user_coins again, just in case *somehow* someone's + # sending coins to themselves. + target_user_coins = target_user.get_setting("coins", None) + target_user_coins = decimal.Decimal(target_user_coins) + target_user.set_setting("coins", str(target_user_coins+send_amount)) event["stdout"].write("%s sent %s coins to %s" % ( |
