Skip to content

Commit

Permalink
Fix an error in restocking logic (Fixes OpenMW#3131)
Browse files Browse the repository at this point in the history
  • Loading branch information
scrawl committed Jan 12, 2016
1 parent fde831e commit 471ad3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/openmw/mwworld/containerstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,10 @@ void MWWorld::ContainerStore::restock (const ESM::InventoryList& items, const MW
{
std::map<std::string, int>::iterator listInMap = allowedForReplace.find(itemOrList);

int restockNum = it->mCount;
int restockNum = std::abs(it->mCount);
//If we know we must restock less, take it into account
if(listInMap != allowedForReplace.end())
restockNum += listInMap->second;//We add, because list items have negative count
restockNum -= std::min(restockNum, listInMap->second);
//restock
addInitialItem(itemOrList, owner, restockNum, true);
}
Expand Down

0 comments on commit 471ad3f

Please sign in to comment.