fix broken amulet infinity charges when bought from npc because the data was set to -1 while createItem accepts only unsigned ints

This commit is contained in:
ErikasKontenis 2020-03-31 12:10:19 +03:00
parent ba7d981b7d
commit 3b4dcabfea

View File

@ -883,7 +883,7 @@ void BehaviourDatabase::checkAction(const NpcBehaviourAction* action, Player* pl
} while (amount);
} else {
for (int32_t i = 0; i < std::max<int32_t>(1, amount); i++) {
Item* item = Item::CreateItem(itemId, data);
Item* item = Item::CreateItem(itemId, data == -1 ? 0 : data);
if (!item) {
break;
}