mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-21 04:39:42 +00:00
Use negative count when restocking item to ensure that its properly tracked (Fixes #3635)
This commit is contained in:
parent
42b1163504
commit
762460f042
1 changed files with 2 additions and 2 deletions
|
@ -553,14 +553,14 @@ void MWWorld::ContainerStore::restock (const ESM::InventoryList& items, const MW
|
|||
if(listInMap != allowedForReplace.end())
|
||||
restockNum -= std::min(restockNum, listInMap->second);
|
||||
//restock
|
||||
addInitialItem(itemOrList, owner, restockNum, true);
|
||||
addInitialItem(itemOrList, owner, -restockNum, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Restocking static item - just restock to the max count
|
||||
int currentCount = count(itemOrList);
|
||||
if (currentCount < std::abs(it->mCount))
|
||||
addInitialItem(itemOrList, owner, std::abs(it->mCount) - currentCount, true);
|
||||
addInitialItem(itemOrList, owner, -(std::abs(it->mCount) - currentCount), true);
|
||||
}
|
||||
}
|
||||
flagAsModified();
|
||||
|
|
Loading…
Reference in a new issue