Fix TC build

This commit is contained in:
Rochet2
2017-06-24 23:22:43 +03:00
parent 6804f6e90f
commit f1117fc2d8
7 changed files with 51 additions and 20 deletions

View File

@@ -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;
}