Merge pull request #139 from ElunaLuaEngine/weather_changes

Remove Weather functions and type, add Map:SetWeather
This commit is contained in:
Rochet2
2015-01-12 19:25:23 +02:00
7 changed files with 49 additions and 191 deletions

View File

@@ -2126,76 +2126,6 @@ namespace LuaGlobalFunctions
return 0;
}
/**
* Gets the [Weather] for a zone.
*
* @param uint32 zoneId : zone Id to check for [Weather]
* @return [Weather] weather
*/
int FindWeather(Eluna* /*E*/, lua_State* L)
{
uint32 zoneId = Eluna::CHECKVAL<uint32>(L, 1);
#ifndef TRINITY
Weather* weather = eWorld->FindWeather(zoneId);
#else
Weather* weather = WeatherMgr::FindWeather(zoneId);
#endif
Eluna::Push(L, weather);
return 1;
}
/**
* Adds weather to a zone and returns the new [Weather] object.
*
* @param uint32 zoneId : zone Id to add [Weather]
* @return [Weather] weather
*/
int AddWeather(Eluna* /*E*/, lua_State* L)
{
uint32 zoneId = Eluna::CHECKVAL<uint32>(L, 1);
#ifndef TRINITY
Weather* weather = eWorld->AddWeather(zoneId);
#else
Weather* weather = WeatherMgr::AddWeather(zoneId);
#endif
Eluna::Push(L, weather);
return 1;
}
/**
* Removes [Weather] from a zone.
*
* @param uint32 zoneId : zone Id to remove [Weather]
*/
int RemoveWeather(Eluna* /*E*/, lua_State* L)
{
uint32 zoneId = Eluna::CHECKVAL<uint32>(L, 1);
#ifndef TRINITY
eWorld->RemoveWeather(zoneId);
#else
WeatherMgr::RemoveWeather(zoneId);
#endif
return 0;
}
/**
* Sends a clear weather packet to a [Player].
*
* Does not affect other [Player]s in the same zone, or affect the zone.
*
* @param [Player] player : [Player] to send the normal weather to
*/
int SendFineWeatherToPlayer(Eluna* /*E*/, lua_State* L)
{
Player* player = Eluna::CHECKOBJ<Player>(L, 1);
#ifndef TRINITY
Weather::SendFineWeatherUpdateToPlayer(player);
#else
WeatherMgr::SendFineWeatherUpdateToPlayer(player);
#endif
return 0;
}
/**
* Returns `true` if the bag and slot is a valid inventory position, otherwise `false`.
*