diff options
author | 2019-02-15 18:40:40 +0100 | |
---|---|---|
committer | 2019-02-15 18:40:40 +0100 | |
commit | 2bfa048bb9be6e2ea2c8645ba3edfa82120914db (patch) | |
tree | d1a04bdb308000bd562b19403d2a98d3b50a7e1a /bot/bot.py | |
parent | Update LoveCalculator to address requested changes (diff) |
Fix LoveCalculator 0% bug
Recently a test of the .love command revealed an unintentional reaction
when 100% are reached. In previous versions this command had used a
gigantic conditional block, checking for the current percentage given by
the love_meter formula. When reaching 0 (meaning that the UserID's
evenly divided with 100) it would automatically convert that 0 to 100. A
big mistake from my side back then.
This has been fixed with these changes. By quickly modifying the formula
to use a mod 101 instead of a mod 100, we get an accurate percentage,
ranging from 0-100% instead of 0-99%. love_matches.json has also been
fixed to address these changes, meaning that the lowest entry now
actually is 0 and the highest 100.
TL;DR:
-> Edited love_meter formula to calculate mod 101 instead of mod 100
-> Edited lowest and highest entry in love_matches.json to be 0 and 100
Diffstat (limited to 'bot/bot.py')
0 files changed, 0 insertions, 0 deletions