mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 23:21:20 -04:00
Fix an error in restocking logic (Fixes #3131)
This commit is contained in:
parent
4e6a60672d
commit
ef1a1125e0
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user