Skip to content

Commit f81b552

Browse files
authored
Fix build after ObjectGuid changes in TC 3.3.5 branch (#526)
1 parent 29ba283 commit f81b552

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

hooks/ServerHooks.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ void Eluna::OnChange(Weather* /*weather*/, uint32 zone, WeatherState state, floa
135135
// Auction House
136136
void Eluna::OnAdd(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
137137
{
138-
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
139-
140138
#if defined ELUNA_TRINITY
139+
Player* owner = eObjectAccessor()FindPlayerByLowGUID(entry->owner);
141140
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
142141
uint32 expiretime = entry->expire_time;
143142
#else
143+
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
144144
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);
145145
uint32 expiretime = entry->expireTime;
146146
#endif
@@ -162,12 +162,12 @@ void Eluna::OnAdd(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
162162

163163
void Eluna::OnRemove(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
164164
{
165-
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
166-
167165
#if defined ELUNA_TRINITY
166+
Player* owner = eObjectAccessor()FindPlayerByLowGUID(entry->owner);
168167
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
169168
uint32 expiretime = entry->expire_time;
170169
#else
170+
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
171171
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);
172172
uint32 expiretime = entry->expireTime;
173173
#endif
@@ -190,12 +190,12 @@ void Eluna::OnRemove(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
190190

191191
void Eluna::OnSuccessful(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
192192
{
193-
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
194-
195193
#if defined ELUNA_TRINITY
194+
Player* owner = eObjectAccessor()FindPlayerByLowGUID(entry->owner);
196195
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
197196
uint32 expiretime = entry->expire_time;
198197
#else
198+
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
199199
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);
200200
uint32 expiretime = entry->expireTime;
201201
#endif
@@ -217,12 +217,12 @@ void Eluna::OnSuccessful(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
217217

218218
void Eluna::OnExpire(AuctionHouseObject* /*ah*/, AuctionEntry* entry)
219219
{
220-
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
221-
222220
#if defined ELUNA_TRINITY
221+
Player* owner = eObjectAccessor()FindPlayerByLowGUID(entry->owner);
223222
Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow);
224223
uint32 expiretime = entry->expire_time;
225224
#else
225+
Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER));
226226
Item* item = eAuctionMgr->GetAItem(entry->itemGuidLow);
227227
uint32 expiretime = entry->expireTime;
228228
#endif

methods/TrinityCore/GlobalMethods.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ namespace LuaGlobalFunctions
335335
int GetPlayerGUID(Eluna* E)
336336
{
337337
uint32 lowguid = E->CHECKVAL<uint32>(1);
338-
E->Push(MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER));
338+
E->Push(ObjectGuid::Create<HIGHGUID_PLAYER>(lowguid));
339339
return 1;
340340
}
341341

@@ -351,7 +351,7 @@ namespace LuaGlobalFunctions
351351
int GetItemGUID(Eluna* E)
352352
{
353353
uint32 lowguid = E->CHECKVAL<uint32>(1);
354-
E->Push(MAKE_NEW_GUID(lowguid, 0, HIGHGUID_ITEM));
354+
E->Push(ObjectGuid::Create<HIGHGUID_ITEM>(lowguid));
355355
return 1;
356356
}
357357

@@ -370,7 +370,7 @@ namespace LuaGlobalFunctions
370370
{
371371
uint32 lowguid = E->CHECKVAL<uint32>(1);
372372
uint32 entry = E->CHECKVAL<uint32>(2);
373-
E->Push(MAKE_NEW_GUID(lowguid, entry, HIGHGUID_GAMEOBJECT));
373+
E->Push(ObjectGuid::Create<HIGHGUID_GAMEOBJECT>(entry, lowguid));
374374
return 1;
375375
}
376376

@@ -389,7 +389,7 @@ namespace LuaGlobalFunctions
389389
{
390390
uint32 lowguid = E->CHECKVAL<uint32>(1);
391391
uint32 entry = E->CHECKVAL<uint32>(2);
392-
E->Push(MAKE_NEW_GUID(lowguid, entry, HIGHGUID_UNIT));
392+
E->Push(ObjectGuid::Create<HIGHGUID_UNIT>(entry, lowguid));
393393
return 1;
394394
}
395395

@@ -2043,7 +2043,7 @@ namespace LuaGlobalFunctions
20432043
}
20442044
}
20452045

2046-
Player* receiverPlayer = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(receiverGUIDLow, 0, HIGHGUID_PLAYER));
2046+
Player* receiverPlayer = eObjectAccessor()FindPlayerByLowGUID(receiverGUIDLow);
20472047
draft.SendMailTo(trans, MailReceiver(receiverPlayer, receiverGUIDLow), sender, MAIL_CHECK_MASK_NONE, delay);
20482048
CharacterDatabase.CommitTransaction(trans);
20492049

0 commit comments

Comments
 (0)