mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Fix TC build
This commit is contained in:
@@ -2882,7 +2882,10 @@ namespace LuaPlayer
|
||||
#ifdef TRINITY
|
||||
// check item starting quest (it can work incorrectly if added without item in inventory)
|
||||
ItemTemplateContainer const* itc = sObjectMgr->GetItemTemplateStore();
|
||||
ItemTemplateContainer::const_iterator result = find_if(itc->begin(), itc->end(), Finder<uint32, ItemTemplate>(entry, &ItemTemplate::StartQuest));
|
||||
ItemTemplateContainer::const_iterator result = std::find_if(itc->begin(), itc->end(), [quest](ItemTemplateContainer::value_type const& value)
|
||||
{
|
||||
return value.second.StartQuest == quest->GetQuestId();
|
||||
});
|
||||
|
||||
if (result != itc->end())
|
||||
return 0;
|
||||
@@ -3319,9 +3322,7 @@ namespace LuaPlayer
|
||||
uint32 itemId = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
uint32 itemCount = Eluna::CHECKVAL<uint32>(L, 3, 1);
|
||||
|
||||
#ifndef TRINITY
|
||||
Eluna::Push(L, player->StoreNewItemInInventorySlot(itemId, itemCount));
|
||||
#else
|
||||
#ifdef TRINITY
|
||||
uint32 noSpaceForCount = 0;
|
||||
ItemPosCountVec dest;
|
||||
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, itemCount, &noSpaceForCount);
|
||||
@@ -3331,10 +3332,12 @@ namespace LuaPlayer
|
||||
if (itemCount == 0 || dest.empty())
|
||||
return 1;
|
||||
|
||||
Item* item = player->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
|
||||
Item* item = player->StoreNewItem(dest, itemId, true, GenerateItemRandomPropertyId(itemId));
|
||||
if (item)
|
||||
player->SendNewItem(item, itemCount, true, false);
|
||||
Eluna::Push(L, item);
|
||||
#else
|
||||
Eluna::Push(L, player->StoreNewItemInInventorySlot(itemId, itemCount));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user