diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp index 443e3962fc..6c517e3dde 100644 --- a/apps/openmw/mwclass/misc.cpp +++ b/apps/openmw/mwclass/misc.cpp @@ -216,10 +216,9 @@ namespace MWClass MWWorld::Ptr newPtr; if (isGold(ptr)) { - newPtr = createGold(cell, getValue(ptr)); + newPtr = createGold(cell, getValue(ptr) * ptr.getRefData().getCount()); newPtr.getRefData() = ptr.getRefData(); newPtr.getCellRef().setRefNum(ptr.getCellRef().getRefNum()); - newPtr.getCellRef().setGoldValue(ptr.getCellRef().getGoldValue()); newPtr.getRefData().setCount(1); } else diff --git a/apps/openmw/mwworld/class.cpp b/apps/openmw/mwworld/class.cpp index 28d351902b..b360e90471 100644 --- a/apps/openmw/mwworld/class.cpp +++ b/apps/openmw/mwworld/class.cpp @@ -391,12 +391,11 @@ namespace MWWorld return newPtr; } - Ptr Class::moveToCell(const Ptr& ptr, CellStore& cell, const ESM::Position& pos, int count) const + Ptr Class::moveToCell(const Ptr& ptr, CellStore& cell, const ESM::Position& pos) const { Ptr newPtr = moveToCell(ptr, cell); newPtr.getRefData().setPosition(pos); newPtr.getCellRef().setPosition(pos); - newPtr.getRefData().setCount(count); return newPtr; } diff --git a/apps/openmw/mwworld/class.hpp b/apps/openmw/mwworld/class.hpp index 9aa72be041..7b7e9135ba 100644 --- a/apps/openmw/mwworld/class.hpp +++ b/apps/openmw/mwworld/class.hpp @@ -317,7 +317,7 @@ namespace MWWorld // The original is expected to be removed after calling this function, // but this function itself doesn't remove the original. virtual Ptr moveToCell(const Ptr& ptr, CellStore& cell) const; - Ptr moveToCell(const Ptr& ptr, CellStore& cell, const ESM::Position& pos, int count) const; + Ptr moveToCell(const Ptr& ptr, CellStore& cell, const ESM::Position& pos) const; Ptr copyToCell(const ConstPtr& ptr, CellStore& cell, const ESM::Position& pos, int count) const; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index b78e7f4124..e3c35ef1cf 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2025,8 +2025,8 @@ namespace MWWorld pos.rot[1] = 0; // copy the object and set its count - Ptr dropped = copy ? copyObjectToCell(object, cell, pos, amount, true) - : moveObjectToCell(object, cell, pos, amount, true); + Ptr dropped + = copy ? copyObjectToCell(object, cell, pos, amount, true) : moveObjectToCell(object, cell, pos, true); // only the player place items in the world, so no need to check actor PCDropped(dropped); @@ -2071,7 +2071,7 @@ namespace MWWorld return dropped; } - Ptr World::moveObjectToCell(const Ptr& object, CellStore* cell, ESM::Position pos, int count, bool adjustPos) + Ptr World::moveObjectToCell(const Ptr& object, CellStore* cell, ESM::Position pos, bool adjustPos) { if (!cell) throw std::runtime_error("moveObjectToCell(): cannot move object to null cell"); @@ -2082,7 +2082,7 @@ namespace MWWorld cell = &mWorldModel.getExterior(index); } - MWWorld::Ptr dropped = object.getClass().moveToCell(object, *cell, pos, count); + MWWorld::Ptr dropped = object.getClass().moveToCell(object, *cell, pos); initObjectInCell(dropped, *cell, adjustPos); @@ -2147,8 +2147,8 @@ namespace MWWorld pos.pos[2] = result.mHitPointWorld.z(); // copy the object and set its count - Ptr dropped = copy ? copyObjectToCell(object, cell, pos, amount, true) - : moveObjectToCell(object, cell, pos, amount, true); + Ptr dropped + = copy ? copyObjectToCell(object, cell, pos, amount, true) : moveObjectToCell(object, cell, pos, true); if (actor == mPlayer->getPlayer()) // Only call if dropped by player PCDropped(dropped); diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 89754ae796..423b3c18c5 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -144,7 +144,7 @@ namespace MWWorld void updateWeather(float duration, bool paused = false); void initObjectInCell(const Ptr& ptr, CellStore& cell, bool adjustPos); - Ptr moveObjectToCell(const Ptr& ptr, CellStore* cell, ESM::Position pos, int count, bool adjustPos); + Ptr moveObjectToCell(const Ptr& ptr, CellStore* cell, ESM::Position pos, bool adjustPos); Ptr copyObjectToCell(const ConstPtr& ptr, CellStore* cell, ESM::Position pos, int count, bool adjustPos); void updateSoundListener();