mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Merge pull request #347 from 55Honey/master
Global:SendMail should return the GUIDs of the created items
This commit is contained in:
@@ -2093,6 +2093,7 @@ namespace LuaGlobalFunctions
|
||||
* @param uint32 cod = 0 : cod money amount
|
||||
* @param uint32 entry = 0 : entry of an [Item] to send with mail
|
||||
* @param uint32 amount = 0 : amount of the [Item] to send with mail
|
||||
* @return uint32 itemGUIDlow : low GUID of the item. Up to 12 values returned, returns nil if no further items are sent
|
||||
*/
|
||||
int SendMail(lua_State* L)
|
||||
{
|
||||
@@ -2156,6 +2157,11 @@ namespace LuaGlobalFunctions
|
||||
item->SaveToDB();
|
||||
#endif
|
||||
draft.AddItem(item);
|
||||
#if defined TRINITY
|
||||
Eluna::Push(L, item->GetGUID().GetCounter());
|
||||
#else
|
||||
Eluna::Push(L, item->GetGUIDLow());
|
||||
#endif
|
||||
++addedItems;
|
||||
}
|
||||
}
|
||||
@@ -2167,7 +2173,7 @@ namespace LuaGlobalFunctions
|
||||
#else
|
||||
draft.SendMailTo(MailReceiver(receiverPlayer, MAKE_NEW_GUID(receiverGUIDLow, 0, HIGHGUID_PLAYER)), sender);
|
||||
#endif
|
||||
return 0;
|
||||
return addedItems;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user