Eluna implement changes from new_mthread to master ~ Does not add multithread support

This commit is contained in:
Rochet2
2014-11-30 01:37:45 +02:00
parent a7f4954fbe
commit 6268216a64
27 changed files with 3331 additions and 3000 deletions

View File

@@ -15,14 +15,14 @@ namespace LuaGameObject
* @param uint32 questId : quest entry Id to check
* @return bool hasQuest
*/
int HasQuest(lua_State* L, GameObject* go)
int HasQuest(Eluna* E, GameObject* go)
{
uint32 questId = Eluna::CHECKVAL<uint32>(L, 2);
uint32 questId = Eluna::CHECKVAL<uint32>(E->L, 2);
#ifndef TRINITY
Eluna::Push(L, go->HasQuest(questId));
Eluna::Push(E->L, go->HasQuest(questId));
#else
Eluna::Push(L, go->hasQuest(questId));
Eluna::Push(E->L, go->hasQuest(questId));
#endif
return 1;
}
@@ -32,9 +32,9 @@ namespace LuaGameObject
*
* @return bool isSpawned
*/
int IsSpawned(lua_State* L, GameObject* go)
int IsSpawned(Eluna* E, GameObject* go)
{
Eluna::Push(L, go->isSpawned());
Eluna::Push(E->L, go->isSpawned());
return 1;
}
@@ -43,9 +43,9 @@ namespace LuaGameObject
*
* @return bool isTransport
*/
int IsTransport(lua_State* L, GameObject* go)
int IsTransport(Eluna* E, GameObject* go)
{
Eluna::Push(L, go->IsTransport());
Eluna::Push(E->L, go->IsTransport());
return 1;
}
@@ -54,15 +54,15 @@ namespace LuaGameObject
*
* @return bool isActive
*/
int IsActive(lua_State* L, GameObject* go)
int IsActive(Eluna* E, GameObject* go)
{
Eluna::Push(L, go->isActiveObject());
Eluna::Push(E->L, go->isActiveObject());
return 1;
}
/*int IsDestructible(lua_State* L, GameObject* go) // TODO: Implementation core side
/*int IsDestructible(Eluna* E, GameObject* go) // TODO: Implementation core side
{
Eluna::Push(L, go->IsDestructibleBuilding());
Eluna::Push(E->L, go->IsDestructibleBuilding());
return 1;
}*/
@@ -71,9 +71,9 @@ namespace LuaGameObject
*
* @return uint32 displayId
*/
int GetDisplayId(lua_State* L, GameObject* go)
int GetDisplayId(Eluna* E, GameObject* go)
{
Eluna::Push(L, go->GetDisplayId());
Eluna::Push(E->L, go->GetDisplayId());
return 1;
}
@@ -92,9 +92,9 @@ namespace LuaGameObject
*
* @return [GOState] goState
*/
int GetGoState(lua_State* L, GameObject* go)
int GetGoState(Eluna* E, GameObject* go)
{
Eluna::Push(L, go->GetGoState());
Eluna::Push(E->L, go->GetGoState());
return 1;
}
@@ -114,9 +114,9 @@ namespace LuaGameObject
*
* @return [LootState] lootState
*/
int GetLootState(lua_State* L, GameObject* go)
int GetLootState(Eluna* E, GameObject* go)
{
Eluna::Push(L, go->getLootState());
Eluna::Push(E->L, go->getLootState());
return 1;
}
@@ -134,9 +134,9 @@ namespace LuaGameObject
*
* @param [GOState] state : all available go states can be seen above
*/
int SetGoState(lua_State* L, GameObject* go)
int SetGoState(Eluna* E, GameObject* go)
{
uint32 state = Eluna::CHECKVAL<uint32>(L, 2, 0);
uint32 state = Eluna::CHECKVAL<uint32>(E->L, 2, 0);
if (state == 0)
go->SetGoState(GO_STATE_ACTIVE);
@@ -164,9 +164,9 @@ namespace LuaGameObject
*
* @param [LootState] state : all available loot states can be seen above
*/
int SetLootState(lua_State* L, GameObject* go)
int SetLootState(Eluna* E, GameObject* go)
{
uint32 state = Eluna::CHECKVAL<uint32>(L, 2, 0);
uint32 state = Eluna::CHECKVAL<uint32>(E->L, 2, 0);
if (state == 0)
go->SetLootState(GO_NOT_READY);
@@ -184,7 +184,7 @@ namespace LuaGameObject
* Saves [GameObject] to the database
*
*/
int SaveToDB(lua_State* /*L*/, GameObject* go)
int SaveToDB(Eluna* /*E*/, GameObject* go)
{
go->SaveToDB();
return 0;
@@ -195,9 +195,9 @@ namespace LuaGameObject
*
* @param bool deleteFromDB : if true, it will delete the [GameObject] from the database
*/
int RemoveFromWorld(lua_State* L, GameObject* go)
int RemoveFromWorld(Eluna* E, GameObject* go)
{
bool deldb = Eluna::CHECKVAL<bool>(L, 2, false);
bool deldb = Eluna::CHECKVAL<bool>(E->L, 2, false);
if (deldb)
go->DeleteFromDB();
go->RemoveFromWorld();
@@ -209,9 +209,9 @@ namespace LuaGameObject
*
* @param uint32 delay : cooldown time in seconds to restore the [GameObject] back to normal
*/
int UseDoorOrButton(lua_State* L, GameObject* go)
int UseDoorOrButton(Eluna* E, GameObject* go)
{
uint32 delay = Eluna::CHECKVAL<uint32>(L, 2, 0);
uint32 delay = Eluna::CHECKVAL<uint32>(E->L, 2, 0);
go->UseDoorOrButton(delay);
return 0;
@@ -222,9 +222,9 @@ namespace LuaGameObject
*
* @param uint32 delay : time in seconds to despawn
*/
int Despawn(lua_State* L, GameObject* go)
int Despawn(Eluna* E, GameObject* go)
{
uint32 delay = Eluna::CHECKVAL<uint32>(L, 2, 1);
uint32 delay = Eluna::CHECKVAL<uint32>(E->L, 2, 1);
if (!delay)
delay = 1;
@@ -238,9 +238,9 @@ namespace LuaGameObject
*
* @param uint32 delay : time of respawn in seconds
*/
int Respawn(lua_State* L, GameObject* go)
int Respawn(Eluna* E, GameObject* go)
{
uint32 delay = Eluna::CHECKVAL<uint32>(L, 2, 1);
uint32 delay = Eluna::CHECKVAL<uint32>(E->L, 2, 1);
if (!delay)
delay = 1;