[7015] Implement support -1 in item_template.stackable and item_template.maxcount fields. By VladimirMangos.

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-01-03 11:06:51 -06:00
1 parent a1a52b710c
commit 9438625a19
15 files changed
+113 -58

No files matched your search

+4 -4
View File
@@ -6374,17 +6374,17 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
}
uint32 item_count = itemCountStr ? atoi(itemCountStr) : 1;
if(item_count < 1 || item_proto->MaxCount && item_count > item_proto->MaxCount)
if(item_count < 1 || item_proto->MaxCount > 0 && item_count > uint32(item_proto->MaxCount))
{
PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, item_count,item_id);
SetSentErrorMessage(true);
return false;
}
while(item_count > item_proto->Stackable)
while(item_count > item_proto->GetMaxStackSize())
{
items.push_back(ItemPair(item_id,item_proto->Stackable));
item_count -= item_proto->Stackable;
items.push_back(ItemPair(item_id,item_proto->GetMaxStackSize()));
item_count -= item_proto->GetMaxStackSize();
}
items.push_back(ItemPair(item_id,item_count));