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,11 +12,11 @@ namespace LuaQuest
/* BOOLEAN */
int HasFlag(lua_State* L, Quest* quest)
{
uint32 flag = sEluna->CHECKVAL<uint32>(L, 2);
uint32 flag = Eluna::CHECKVAL<uint32>(L, 2);
#ifdef MANGOS
sEluna->Push(L, quest->HasQuestFlag((QuestFlags)flag));
Eluna::Push(L, quest->HasQuestFlag((QuestFlags)flag));
#else
sEluna->Push(L, quest->HasFlag(flag));
Eluna::Push(L, quest->HasFlag(flag));
#endif
return 1;
}
@@ -24,73 +24,73 @@ namespace LuaQuest
#ifndef CLASSIC
int IsDaily(lua_State* L, Quest* quest)
{
sEluna->Push(L, quest->IsDaily());
Eluna::Push(L, quest->IsDaily());
return 1;
}
#endif
int IsRepeatable(lua_State* L, Quest* quest)
{
sEluna->Push(L, quest->IsRepeatable());
Eluna::Push(L, quest->IsRepeatable());
return 1;
}
/* GETTERS */
int GetId(lua_State* L, Quest* quest)
{
sEluna->Push(L, quest->GetQuestId());
Eluna::Push(L, quest->GetQuestId());
return 1;
}
int GetLevel(lua_State* L, Quest* quest)
{
sEluna->Push(L, quest->GetQuestLevel());
Eluna::Push(L, quest->GetQuestLevel());
return 1;
}
int GetMinLevel(lua_State* L, Quest* quest)
{
sEluna->Push(L, quest->GetMinLevel());
Eluna::Push(L, quest->GetMinLevel());
return 1;
}
int GetNextQuestId(lua_State* L, Quest* quest)
{
sEluna->Push(L, quest->GetNextQuestId());
Eluna::Push(L, quest->GetNextQuestId());
return 1;
}
int GetPrevQuestId(lua_State* L, Quest* quest)
{
sEluna->Push(L, quest->GetPrevQuestId());
Eluna::Push(L, quest->GetPrevQuestId());
return 1;
}
int GetNextQuestInChain(lua_State* L, Quest* quest)
{
sEluna->Push(L, quest->GetNextQuestInChain());
Eluna::Push(L, quest->GetNextQuestInChain());
return 1;
}
int GetFlags(lua_State* L, Quest* quest)
{
#ifdef MANGOS
sEluna->Push(L, quest->GetQuestFlags());
Eluna::Push(L, quest->GetQuestFlags());
#else
sEluna->Push(L, quest->GetFlags());
Eluna::Push(L, quest->GetFlags());
#endif
return 1;
}
int GetType(lua_State* L, Quest* quest)
{
sEluna->Push(L, quest->GetType());
Eluna::Push(L, quest->GetType());
return 1;
}
/*int GetMaxLevel(lua_State* L, Quest* quest)
{
sEluna->Push(L, quest->GetMaxLevel());
Eluna::Push(L, quest->GetMaxLevel());
return 1;
}*/
};