From 0450420157b4076e62130cd7ca904cc075e7a105 Mon Sep 17 00:00:00 2001 From: SoglaHash <74299960+SoglaHash@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:57:54 +0200 Subject: [PATCH] fix(Core/Weather): Wrong change type algorithm (#12729) * fix(Core/Weather): Wrong change type algorithm There's a rare bug that occurs where it starts raining in zones that shouldn't Closes https://github.com/azerothcore/azerothcore-wotlk/issues/12711#issuecomment-1214226996 * Update Weather.cpp --- src/server/game/Weather/Weather.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp index 6ec5ea2fd..bfecc5c6a 100644 --- a/src/server/game/Weather/Weather.cpp +++ b/src/server/game/Weather/Weather.cpp @@ -145,7 +145,7 @@ bool Weather::ReGenerate() uint32 chance2 = chance1 + m_weatherChances->data[season].snowChance; uint32 chance3 = chance2 + m_weatherChances->data[season].stormChance; - uint32 rnd = urand(0, 99); + uint32 rnd = urand(1, 100); if (rnd <= chance1) m_type = WEATHER_TYPE_RAIN; else if (rnd <= chance2)