mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Fix: merchants stack identical items
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8388 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1648,9 +1648,9 @@ void AddItemToArmsDealerInventory( UINT8 ubArmsDealer, OBJECTTYPE& object )
|
|||||||
{
|
{
|
||||||
//we can only add items to a stack if the item has no attachments (not even default)
|
//we can only add items to a stack if the item has no attachments (not even default)
|
||||||
//and if it is either perfect or ammo (and same amount of ammo)
|
//and if it is either perfect or ammo (and same amount of ammo)
|
||||||
if (/*object[0]->attachments.empty() == true*/ object[0]->AttachmentListSize() &&
|
if ( !object[0]->AttachmentListSize() &&
|
||||||
(object[0]->data.objectStatus == 100 || Item [ object.usItem ].usItemClass == IC_AMMO)) {
|
(object[0]->data.objectStatus == 100 || Item [ object.usItem ].usItemClass == IC_AMMO) )
|
||||||
|
{
|
||||||
//first find existing items with same perfect status, if found add to that, else create new one
|
//first find existing items with same perfect status, if found add to that, else create new one
|
||||||
for (DealerItemList::iterator iter = gArmsDealersInventory[ubArmsDealer].begin();
|
for (DealerItemList::iterator iter = gArmsDealersInventory[ubArmsDealer].begin();
|
||||||
iter != gArmsDealersInventory[ubArmsDealer].end(); ++iter) {
|
iter != gArmsDealersInventory[ubArmsDealer].end(); ++iter) {
|
||||||
|
|||||||
Reference in New Issue
Block a user