mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Fix an error in restocking logic (Fixes #3131)
This commit is contained in:
parent
fde831e2e0
commit
471ad3fb0f
1 changed files with 2 additions and 2 deletions
|
@ -529,10 +529,10 @@ void MWWorld::ContainerStore::restock (const ESM::InventoryList& items, const MW
|
||||||
{
|
{
|
||||||
std::map<std::string, int>::iterator listInMap = allowedForReplace.find(itemOrList);
|
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 we know we must restock less, take it into account
|
||||||
if(listInMap != allowedForReplace.end())
|
if(listInMap != allowedForReplace.end())
|
||||||
restockNum += listInMap->second;//We add, because list items have negative count
|
restockNum -= std::min(restockNum, listInMap->second);
|
||||||
//restock
|
//restock
|
||||||
addInitialItem(itemOrList, owner, restockNum, true);
|
addInitialItem(itemOrList, owner, restockNum, true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue