mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
Merge pull request #1528 from noudess/merchant
Fix bug where stacks of non-stackable items are removed when you buy 1.
This commit is contained in:
commit
b6ba493450
@ -361,7 +361,8 @@ void Zone::DumpMerchantList(uint32 npcid) {
|
|||||||
|
|
||||||
int Zone::SaveTempItem(uint32 merchantid, uint32 npcid, uint32 item, int32 charges, bool sold) {
|
int Zone::SaveTempItem(uint32 merchantid, uint32 npcid, uint32 item, int32 charges, bool sold) {
|
||||||
|
|
||||||
LogInventory("Transaction of [{}] [{}]", charges, item);
|
LogInventory("[{}] [{}] charges of [{}]", ((sold) ? "Sold" : "Bought"),
|
||||||
|
charges, item);
|
||||||
//DumpMerchantList(npcid);
|
//DumpMerchantList(npcid);
|
||||||
// Iterate past main items.
|
// Iterate past main items.
|
||||||
// If the item being transacted is in this list, return 0;
|
// If the item being transacted is in this list, return 0;
|
||||||
@ -419,8 +420,7 @@ int Zone::SaveTempItem(uint32 merchantid, uint32 npcid, uint32 item, int32 charg
|
|||||||
if (!ml.origslot) {
|
if (!ml.origslot) {
|
||||||
ml.origslot = ml.slot;
|
ml.origslot = ml.slot;
|
||||||
}
|
}
|
||||||
bool is_stackable = database.GetItem(item)->Stackable;
|
if (ml.charges > 0) {
|
||||||
if ((is_stackable && charges > 0) || (!is_stackable && sold)) {
|
|
||||||
database.SaveMerchantTemp(npcid, ml.origslot, item, ml.charges);
|
database.SaveMerchantTemp(npcid, ml.origslot, item, ml.charges);
|
||||||
tmp_merlist.push_back(ml);
|
tmp_merlist.push_back(ml);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user