mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 15:58:36 +00:00
[Commands] Add #emptyinventory Command. (#1684)
* [Commands] Add #emptyinventory Command. - Allows you empty you or your target's inventory completely. (Equipment, General, Bank, and Shared Bank) - Fixed an issue not allowing quest::removeitem(item_id, quanity) to remove 0 charge items. - Fixed an issue not allowing eq.remove_item(item_id, quanity) to remove 0 charge items. * Update command.cpp * Update client.cpp
This commit is contained in:
+4
-3
@@ -10276,10 +10276,11 @@ void Client::RemoveItem(uint32 item_id, uint32 quantity)
|
||||
|
||||
item = GetInv().GetItem(slot_id);
|
||||
if (item && item->GetID() == item_id) {
|
||||
int stack_size = item->IsStackable() ? item->GetCharges() : 1;
|
||||
int charges = item->IsStackable() ? item->GetCharges() : 0;
|
||||
int stack_size = std::max(charges, 1);
|
||||
if ((removed_count + stack_size) <= quantity) {
|
||||
removed_count += stack_size;
|
||||
DeleteItemInInventory(slot_id, stack_size, true);
|
||||
DeleteItemInInventory(slot_id, charges, true);
|
||||
} else {
|
||||
int amount_left = (quantity - removed_count);
|
||||
if (amount_left > 0 && stack_size >= amount_left) {
|
||||
@@ -10808,4 +10809,4 @@ uint16 Client::LearnDisciplines(uint8 min_level, uint8 max_level)
|
||||
}
|
||||
|
||||
return learned_disciplines;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user