diff --git a/src/LuaEngine/methods/MapMethods.h b/src/LuaEngine/methods/MapMethods.h index eed59bb..f71f507 100644 --- a/src/LuaEngine/methods/MapMethods.h +++ b/src/LuaEngine/methods/MapMethods.h @@ -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(L, 2); uint32 weatherType = Eluna::CHECKVAL(L, 3); float grade = Eluna::CHECKVAL(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;