mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Sync AC weather PR changes (#306)
This commit is contained in:
@@ -238,14 +238,11 @@ namespace LuaMap
|
|||||||
*/
|
*/
|
||||||
int SetWeather(lua_State* L, Map* map)
|
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 zoneId = Eluna::CHECKVAL<uint32>(L, 2);
|
||||||
uint32 weatherType = Eluna::CHECKVAL<uint32>(L, 3);
|
uint32 weatherType = Eluna::CHECKVAL<uint32>(L, 3);
|
||||||
float grade = Eluna::CHECKVAL<float>(L, 4);
|
float grade = Eluna::CHECKVAL<float>(L, 4);
|
||||||
|
|
||||||
Weather* weather = WeatherMgr::FindWeather(zoneId);
|
Weather* weather = map->GetOrGenerateZoneDefaultWeather(zoneId);
|
||||||
if (!weather)
|
|
||||||
weather = WeatherMgr::AddWeather(zoneId);
|
|
||||||
if (weather)
|
if (weather)
|
||||||
weather->SetWeather((WeatherType)weatherType, grade);
|
weather->SetWeather((WeatherType)weatherType, grade);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user