Accept a ConstPtr in getItemsOwnedBy, getContainersOwnedBy

openmw-38
scrawl 9 years ago
parent 388aed1748
commit 029d467ea5

@ -409,9 +409,9 @@ namespace MWBase
virtual float getWindSpeed() = 0; virtual float getWindSpeed() = 0;
virtual void getContainersOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out) = 0; virtual void getContainersOwnedBy (const MWWorld::ConstPtr& npc, std::vector<MWWorld::Ptr>& out) = 0;
///< get all containers in active cells owned by this Npc ///< get all containers in active cells owned by this Npc
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out) = 0; virtual void getItemsOwnedBy (const MWWorld::ConstPtr& npc, std::vector<MWWorld::Ptr>& out) = 0;
///< get all items in active cells owned by this Npc ///< get all items in active cells owned by this Npc
virtual bool getLOS(const MWWorld::Ptr& actor,const MWWorld::Ptr& targetActor) = 0; virtual bool getLOS(const MWWorld::Ptr& actor,const MWWorld::Ptr& targetActor) = 0;

@ -2260,13 +2260,13 @@ namespace MWWorld
struct GetContainersOwnedByVisitor struct GetContainersOwnedByVisitor
{ {
GetContainersOwnedByVisitor(const MWWorld::Ptr& owner, std::vector<MWWorld::Ptr>& out) GetContainersOwnedByVisitor(const MWWorld::ConstPtr& owner, std::vector<MWWorld::Ptr>& out)
: mOwner(owner) : mOwner(owner)
, mOut(out) , mOut(out)
{ {
} }
MWWorld::Ptr mOwner; MWWorld::ConstPtr mOwner;
std::vector<MWWorld::Ptr>& mOut; std::vector<MWWorld::Ptr>& mOut;
bool operator()(const MWWorld::Ptr& ptr) bool operator()(const MWWorld::Ptr& ptr)
@ -2281,7 +2281,7 @@ namespace MWWorld
} }
}; };
void World::getContainersOwnedBy (const MWWorld::Ptr& owner, std::vector<MWWorld::Ptr>& out) void World::getContainersOwnedBy (const MWWorld::ConstPtr& owner, std::vector<MWWorld::Ptr>& out)
{ {
const Scene::CellStoreCollection& collection = mWorldScene->getActiveCells(); const Scene::CellStoreCollection& collection = mWorldScene->getActiveCells();
for (Scene::CellStoreCollection::const_iterator cellIt = collection.begin(); cellIt != collection.end(); ++cellIt) for (Scene::CellStoreCollection::const_iterator cellIt = collection.begin(); cellIt != collection.end(); ++cellIt)
@ -2303,7 +2303,7 @@ namespace MWWorld
} }
}; };
void World::getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out) void World::getItemsOwnedBy (const MWWorld::ConstPtr& npc, std::vector<MWWorld::Ptr>& out)
{ {
const Scene::CellStoreCollection& collection = mWorldScene->getActiveCells(); const Scene::CellStoreCollection& collection = mWorldScene->getActiveCells();
for (Scene::CellStoreCollection::const_iterator cellIt = collection.begin(); cellIt != collection.end(); ++cellIt) for (Scene::CellStoreCollection::const_iterator cellIt = collection.begin(); cellIt != collection.end(); ++cellIt)

@ -513,9 +513,9 @@ namespace MWWorld
virtual float getWindSpeed(); virtual float getWindSpeed();
virtual void getContainersOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out); virtual void getContainersOwnedBy (const MWWorld::ConstPtr& npc, std::vector<MWWorld::Ptr>& out);
///< get all containers in active cells owned by this Npc ///< get all containers in active cells owned by this Npc
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out); virtual void getItemsOwnedBy (const MWWorld::ConstPtr& npc, std::vector<MWWorld::Ptr>& out);
///< get all items in active cells owned by this Npc ///< get all items in active cells owned by this Npc
virtual bool getLOS(const MWWorld::Ptr& actor,const MWWorld::Ptr& targetActor); virtual bool getLOS(const MWWorld::Ptr& actor,const MWWorld::Ptr& targetActor);

Loading…
Cancel
Save