mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Improved pushing so that a single userdata is used per object pushed. Made everything use the singleton less, allowing more free code and easier to implement multithreading later. Made macros for hookmgr and fixed the issue with hooks called inside hooks.
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
/*
|
|
* Copyright (C) 2010 - 2014 Eluna Lua Engine <http://emudevs.com/>
|
|
* This program is free software licensed under GPL version 3
|
|
* Please see the included DOCS/LICENSE.md for more information
|
|
*/
|
|
|
|
#ifndef WEATHERMETHODS_H
|
|
#define WEATHERMETHODS_H
|
|
|
|
namespace LuaWeather
|
|
{
|
|
/* GETTERS */
|
|
int GetZoneId(lua_State* L, Weather* weather)
|
|
{
|
|
Eluna::Push(L, weather->GetZone());
|
|
return 1;
|
|
}
|
|
|
|
/* SETTERS */
|
|
int SetWeather(lua_State* L, Weather* weather)
|
|
{
|
|
uint32 weatherType = Eluna::CHECKVAL<uint32>(L, 2);
|
|
float grade = Eluna::CHECKVAL<float>(L, 3);
|
|
|
|
weather->SetWeather((WeatherType)weatherType, grade);
|
|
return 0;
|
|
}
|
|
|
|
int SendWeatherUpdateToPlayer(lua_State* L, Weather* weather)
|
|
{
|
|
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
|
|
|
|
weather->SendWeatherUpdateToPlayer(player);
|
|
return 0;
|
|
}
|
|
|
|
/* OTHER */
|
|
int Regenerate(lua_State* L, Weather* weather)
|
|
{
|
|
Eluna::Push(L, weather->ReGenerate());
|
|
return 1;
|
|
}
|
|
|
|
int UpdateWeather(lua_State* L, Weather* weather)
|
|
{
|
|
Eluna::Push(L, weather->UpdateWeather());
|
|
return 1;
|
|
}
|
|
};
|
|
|
|
#endif
|