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.
This commit is contained in:
Rochet2
2014-06-01 23:58:28 +03:00
committed by Foereaper
parent e131f36d39
commit b1f85bfc21
25 changed files with 3169 additions and 3666 deletions

View File

@@ -12,15 +12,15 @@ namespace LuaWeather
/* GETTERS */
int GetZoneId(lua_State* L, Weather* weather)
{
sEluna->Push(L, weather->GetZone());
Eluna::Push(L, weather->GetZone());
return 1;
}
/* SETTERS */
int SetWeather(lua_State* L, Weather* weather)
{
uint32 weatherType = sEluna->CHECKVAL<uint32>(L, 2);
float grade = sEluna->CHECKVAL<float>(L, 3);
uint32 weatherType = Eluna::CHECKVAL<uint32>(L, 2);
float grade = Eluna::CHECKVAL<float>(L, 3);
weather->SetWeather((WeatherType)weatherType, grade);
return 0;
@@ -28,7 +28,7 @@ namespace LuaWeather
int SendWeatherUpdateToPlayer(lua_State* L, Weather* weather)
{
Player* player = sEluna->CHECKOBJ<Player>(L, 2);
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
weather->SendWeatherUpdateToPlayer(player);
return 0;
@@ -37,13 +37,13 @@ namespace LuaWeather
/* OTHER */
int Regenerate(lua_State* L, Weather* weather)
{
sEluna->Push(L, weather->ReGenerate());
Eluna::Push(L, weather->ReGenerate());
return 1;
}
int UpdateWeather(lua_State* L, Weather* weather)
{
sEluna->Push(L, weather->UpdateWeather());
Eluna::Push(L, weather->UpdateWeather());
return 1;
}
};