mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 12:49:40 +00:00
Fix "additem gold_100" behavior
This commit is contained in:
parent
75e5023590
commit
aefcd1ad07
1 changed files with 3 additions and 5 deletions
|
@ -302,20 +302,18 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImp (const Ptr& ptr,
|
||||||
// this ensures that gold piles of different sizes stack with each other (also, several scripts rely on Gold_001 for detecting player gold)
|
// this ensures that gold piles of different sizes stack with each other (also, several scripts rely on Gold_001 for detecting player gold)
|
||||||
if(MWClass::Miscellaneous().isGold(ptr))
|
if(MWClass::Miscellaneous().isGold(ptr))
|
||||||
{
|
{
|
||||||
int realCount = count * ptr.getClass().getValue(ptr);
|
|
||||||
|
|
||||||
for (MWWorld::ContainerStoreIterator iter (begin(type)); iter!=end(); ++iter)
|
for (MWWorld::ContainerStoreIterator iter (begin(type)); iter!=end(); ++iter)
|
||||||
{
|
{
|
||||||
if (Misc::StringUtils::ciEqual((*iter).getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId))
|
if (Misc::StringUtils::ciEqual((*iter).getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId))
|
||||||
{
|
{
|
||||||
iter->getRefData().setCount(iter->getRefData().getCount() + realCount);
|
iter->getRefData().setCount(iter->getRefData().getCount() + count);
|
||||||
flagAsModified();
|
flagAsModified();
|
||||||
return iter;
|
return iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::ManualRef ref(esmStore, MWWorld::ContainerStore::sGoldId, realCount);
|
MWWorld::ManualRef ref(esmStore, MWWorld::ContainerStore::sGoldId, count);
|
||||||
return addNewStack(ref.getPtr(), realCount);
|
return addNewStack(ref.getPtr(), count);
|
||||||
}
|
}
|
||||||
|
|
||||||
// determine whether to stack or not
|
// determine whether to stack or not
|
||||||
|
|
Loading…
Reference in a new issue