Sync AC weather PR changes (#306)

This commit is contained in:
Takenbacon
2025-09-29 17:36:48 -07:00
committed by GitHub
parent 2dcacfe2b4
commit 83aca7b237

View File

@@ -238,14 +238,11 @@ namespace LuaMap
*/
int SetWeather(lua_State* L, Map* map)
{
(void)map; // ensure that the variable is referenced in order to pass compiler checks
uint32 zoneId = Eluna::CHECKVAL<uint32>(L, 2);
uint32 weatherType = Eluna::CHECKVAL<uint32>(L, 3);
float grade = Eluna::CHECKVAL<float>(L, 4);
Weather* weather = WeatherMgr::FindWeather(zoneId);
if (!weather)
weather = WeatherMgr::AddWeather(zoneId);
Weather* weather = map->GetOrGenerateZoneDefaultWeather(zoneId);
if (weather)
weather->SetWeather((WeatherType)weatherType, grade);
return 0;