Don't calculate user_coins(+/-)coin_bet
twice
This commit is contained in:
parent
a9202a6abf
commit
3d2acc2f61
1 changed files with 6 additions and 6 deletions
|
@ -167,21 +167,21 @@ class Module(object):
|
|||
win = side_name == chosen_side
|
||||
|
||||
if win:
|
||||
event["user"].set_setting("coins", str(user_coins+coin_bet))
|
||||
new_coins = str(user_coins+coin_bet)
|
||||
event["user"].set_setting("coins", new_coins)
|
||||
event["stdout"].write(
|
||||
"%s flips %s and wins %s coin%s! (new total: %s)" % (
|
||||
event["user"].nickname, side_name, coin_bet_str,
|
||||
"" if coin_bet == 1 else "s",
|
||||
user_coins+coin_bet
|
||||
"" if coin_bet == 1 else "s", new_coins
|
||||
)
|
||||
)
|
||||
else:
|
||||
event["user"].set_setting("coins", str(user_coins-coin_bet))
|
||||
new_coins = str(user_coins-coin_bet)
|
||||
event["user"].set_setting("coins", new_coins)
|
||||
event["stdout"].write(
|
||||
"%s flips %s and loses %s coin%s! (new total: %s)" % (
|
||||
event["user"].nickname, side_name, coin_bet_str,
|
||||
"" if coin_bet == 1 else "s",
|
||||
user_coins-coin_bet
|
||||
"" if coin_bet == 1 else "s", new_coins
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue