diff --git a/GlobalMethods.h b/GlobalMethods.h index 4dbf972..01e5bb9 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -2128,6 +2128,7 @@ namespace LuaGlobalFunctions SQLTransaction trans = CharacterDatabase.BeginTransaction(); #endif uint8 addedItems = 0; + uint32 mailGUID = 0; while (addedItems <= MAX_MAIL_ITEMS && i + 2 <= argAmount) { uint32 entry = Eluna::CHECKVAL(L, ++i); @@ -2156,6 +2157,13 @@ namespace LuaGlobalFunctions item->SaveToDB(); #endif draft.AddItem(item); + + if (!mailGUID > 0) + { + mailGUID = item->GetGUIDLow(); + Eluna::Push(L, mailGUID); + } + ++addedItems; } } @@ -2167,7 +2175,7 @@ namespace LuaGlobalFunctions #else draft.SendMailTo(MailReceiver(receiverPlayer, MAKE_NEW_GUID(receiverGUIDLow, 0, HIGHGUID_PLAYER)), sender); #endif - return 0; + return 1; } /**