From 59111f37d7f29cac4685b52b4b921f08e0170072 Mon Sep 17 00:00:00 2001 From: scoobybejesus <21372487+scoobybejesus@users.noreply.github.com> Date: Thu, 8 Jul 2021 19:40:41 -0400 Subject: [PATCH] Fixed direction math. Whoops --- trifling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trifling.py b/trifling.py index ad2b6df..31cf4eb 100644 --- a/trifling.py +++ b/trifling.py @@ -919,7 +919,7 @@ def weather(bot, trigger): def calculate_bearing(d): dirs = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW'] ix = int(round(d / (360. / len(dirs)))) - return dirs[(ix*2) % len(dirs)] + return dirs[(ix) % len(dirs)] direction = calculate_bearing(wind_deg) @@ -965,7 +965,7 @@ def weatherf(bot, trigger): def calculate_bearing(d): dirs = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW'] ix = int(round(d / (360. / len(dirs)))) - return dirs[(ix*2) % len(dirs)] + return dirs[(ix) % len(dirs)] direction = calculate_bearing(wind_deg)