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

@@ -116,7 +116,11 @@ bool Eluna::OnAreaTrigger(Player* pPlayer, AreaTriggerEntry const* pTrigger)
{
START_HOOK_WITH_RETVAL(TRIGGER_EVENT_ON_TRIGGER, false);
Push(pPlayer);
#ifndef AZEROTHCORE
Push(pTrigger->id);
#else
Push(pTrigger->entry);
#endif
return CallAllFunctionsBool(ServerEventBindings, key);
}
@@ -137,6 +141,9 @@ void Eluna::OnAdd(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
#ifdef TRINITY
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
uint32 expiretime = entry->expire_time;
#elif AZEROTHCORE
Item* item = eAuctionMgr->GetAItem(entry->item_guidlow);
uint32 expiretime = entry->expire_time;
#else
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);
uint32 expiretime = entry->expireTime;
@@ -164,6 +171,9 @@ void Eluna::OnRemove(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
#ifdef TRINITY
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
uint32 expiretime = entry->expire_time;
#elif AZEROTHCORE
Item* item = eAuctionMgr->GetAItem(entry->item_guidlow);
uint32 expiretime = entry->expire_time;
#else
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);
uint32 expiretime = entry->expireTime;
@@ -191,6 +201,9 @@ void Eluna::OnSuccessful(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
#ifdef TRINITY
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
uint32 expiretime = entry->expire_time;
#elif AZEROTHCORE
Item* item = eAuctionMgr->GetAItem(entry->item_guidlow);
uint32 expiretime = entry->expire_time;
#else
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);
uint32 expiretime = entry->expireTime;
@@ -218,6 +231,9 @@ void Eluna::OnExpire(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
#ifdef TRINITY
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
uint32 expiretime = entry->expire_time;
#elif AZEROTHCORE
Item* item = eAuctionMgr->GetAItem(entry->item_guidlow);
uint32 expiretime = entry->expire_time;
#else
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);
uint32 expiretime = entry->expireTime;
@@ -246,10 +262,17 @@ void Eluna::OnOpenStateChange(bool open)
CallAllFunctions(ServerEventBindings, key);
}
#ifndef AZEROTHCORE
void Eluna::OnConfigLoad(bool reload)
#else
void Eluna::OnConfigLoad(bool reload, bool isBefore)
#endif
{
START_HOOK(WORLD_EVENT_ON_CONFIG_LOAD);
Push(reload);
#ifdef AZEROTHCORE
Push(isBefore);
#endif
CallAllFunctions(ServerEventBindings, key);
}