From 2bfa048bb9be6e2ea2c8645ba3edfa82120914db Mon Sep 17 00:00:00 2001 From: Darth Delay Date: Fri, 15 Feb 2019 18:40:40 +0100 Subject: 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 --- bot/resources/valentines/love_matches.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bot/resources') diff --git a/bot/resources/valentines/love_matches.json b/bot/resources/valentines/love_matches.json index a3d2c282..a39c5d6b 100644 --- a/bot/resources/valentines/love_matches.json +++ b/bot/resources/valentines/love_matches.json @@ -1,5 +1,5 @@ { - "0": { + "100": { "titles": [ "\ud83d\udc9b When will you two marry? \ud83d\udc9b", "\ud83d\udc9b Now kiss already \ud83d\udc9b" @@ -49,7 +49,7 @@ ], "text": "There might be a chance of this relationship working out somewhat well, but it is not very high. With a lot of time and effort you'll get it to work eventually, however don't count on it. It might fall apart quicker than you'd expect." }, - "1": { + "0": { "titles": [ "\ud83d\udc94 There's no real connection between you two \ud83d\udc94" ], -- cgit v1.2.3