From 3b4dcabfea48e9dfdab73a1474d72799c645cd8a Mon Sep 17 00:00:00 2001 From: ErikasKontenis Date: Tue, 31 Mar 2020 12:10:19 +0300 Subject: [PATCH] fix broken amulet infinity charges when bought from npc because the data was set to -1 while createItem accepts only unsigned ints --- src/behaviourdatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/behaviourdatabase.cpp b/src/behaviourdatabase.cpp index 59c4b3a..c8cade5 100644 --- a/src/behaviourdatabase.cpp +++ b/src/behaviourdatabase.cpp @@ -883,7 +883,7 @@ void BehaviourDatabase::checkAction(const NpcBehaviourAction* action, Player* pl } while (amount); } else { for (int32_t i = 0; i < std::max(1, amount); i++) { - Item* item = Item::CreateItem(itemId, data); + Item* item = Item::CreateItem(itemId, data == -1 ? 0 : data); if (!item) { break; }