AZEROTHCORE compatibility (#271)

* Done Compatible AZEROTHCORE.

* Fix TC build

* Try fix whitespace (trailing and tabs2spaces)

* Remove undefs and TC_LOG defines

* Revert indentation change

* Indentation and style change

* Add more possible SQL types to query

* change bg hooks OnBGEnd parameter type.
This commit is contained in:
ayase
2018-06-06 23:42:46 +08:00
committed by Rochet2
parent 2cedb8c5af
commit 9b5499db9c
31 changed files with 869 additions and 510 deletions

View File

@@ -176,10 +176,10 @@ namespace LuaItem
int HasQuest(lua_State* L, Item* item)
{
uint32 quest = Eluna::CHECKVAL<uint32>(L, 2);
#ifndef TRINITY
Eluna::Push(L, item->HasQuest(quest));
#else
#if defined TRINITY || AZEROTHCORE
Eluna::Push(L, item->hasQuest(quest));
#else
Eluna::Push(L, item->HasQuest(quest));
#endif
return 1;
}
@@ -315,10 +315,10 @@ namespace LuaItem
int GetOwnerGUID(lua_State* L, Item* item)
{
#ifndef TRINITY
Eluna::Push(L, item->GetOwnerGuid());
#else
#if defined TRINITY || AZEROTHCORE
Eluna::Push(L, item->GetOwnerGUID());
#else
Eluna::Push(L, item->GetOwnerGuid());
#endif
return 1;
}
@@ -630,10 +630,10 @@ namespace LuaItem
int SetOwner(lua_State* L, Item* item)
{
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
#ifndef TRINITY
item->SetOwnerGuid(player->GET_GUID());
#else
#if defined TRINITY || AZEROTHCORE
item->SetOwnerGUID(player->GET_GUID());
#else
item->SetOwnerGuid(player->GET_GUID());
#endif
return 0;
}
@@ -736,11 +736,11 @@ namespace LuaItem
*/
int SaveToDB(lua_State* /*L*/, Item* item)
{
#ifndef TRINITY
item->SaveToDB();
#else
#if defined TRINITY || AZEROTHCORE
SQLTransaction trans = SQLTransaction(NULL);
item->SaveToDB(trans);
#else
item->SaveToDB();
#endif
return 0;
}