Gold fixes (when did this break?)

actorid
scrawl 11 years ago
parent 9bf7bf529c
commit baf55df7a1

@ -93,7 +93,9 @@ namespace MWClass
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
ptr.get<ESM::Miscellaneous>();
int value = (ptr.getCellRef().mGoldValue == 1) ? ref->mBase->mData.mValue : ptr.getCellRef().mGoldValue;
int value = ref->mBase->mData.mValue;
if (ptr.getCellRef().mGoldValue > 1 && ptr.getRefData().getCount() == 1)
value = ptr.getCellRef().mGoldValue;
if (ptr.getCellRef().mSoul != "")
{

@ -499,8 +499,6 @@ namespace MWGui
return;
int count = object.getRefData().getCount();
if (object.getCellRef().mGoldValue > 1)
count = object.getCellRef().mGoldValue;
// add to player inventory
// can't use ActionTake here because we need an MWWorld::Ptr to the newly inserted object

@ -134,7 +134,11 @@ bool MWWorld::ContainerStore::stacks(const Ptr& ptr1, const Ptr& ptr2)
MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add(const std::string &id, int count, const Ptr &actorPtr)
{
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), id, count);
return add(ref.getPtr(), count, actorPtr, true);
// a bit pointless to set owner for the player
if (actorPtr.getRefData().getHandle() != "player")
return add(ref.getPtr(), count, actorPtr, true);
else
return add(ref.getPtr(), count, actorPtr, false);
}
MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& itemPtr, int count, const Ptr& actorPtr, bool setOwner)
@ -194,7 +198,9 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImp (const Ptr& ptr,
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_025")
|| Misc::StringUtils::ciEqual(ptr.getCellRef().mRefID, "gold_100"))
{
int realCount = MWWorld::Class::get(ptr).getValue(ptr) * ptr.getRefData().getCount();
int realCount = ptr.getRefData().getCount();
if (ptr.getCellRef().mGoldValue > 1 && realCount == 1)
realCount = ptr.getCellRef().mGoldValue;
for (MWWorld::ContainerStoreIterator iter (begin(type)); iter!=end(); ++iter)
{

Loading…
Cancel
Save