|
|
@ -21,6 +21,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "../mwworld/class.hpp"
|
|
|
|
#include "../mwworld/class.hpp"
|
|
|
|
#include "../mwworld/cellstore.hpp"
|
|
|
|
#include "../mwworld/cellstore.hpp"
|
|
|
|
|
|
|
|
#include "../mwworld/containerstore.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
#include "../mwmechanics/npcstats.hpp"
|
|
|
|
#include "../mwmechanics/npcstats.hpp"
|
|
|
|
|
|
|
|
|
|
|
@ -434,6 +435,16 @@ namespace MWScript
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ref2 = MWBase::Environment::get().getWorld()->getPtr(id, false);
|
|
|
|
ref2 = MWBase::Environment::get().getWorld()->getPtr(id, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ref2.getContainerStore()) // is the object contained?
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MWWorld::Ptr container = MWBase::Environment::get().getWorld()->findContainer(ref2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!container.isEmpty())
|
|
|
|
|
|
|
|
ref2 = container;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
throw std::runtime_error("failed to find container ptr");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const MWWorld::Ptr ref = MWBase::Environment::get().getWorld()->getPtr(name, false);
|
|
|
|
const MWWorld::Ptr ref = MWBase::Environment::get().getWorld()->getPtr(name, false);
|
|
|
|
|
|
|
|
|
|
|
|
// If the objects are in different worldspaces, return a large value (just like vanilla)
|
|
|
|
// If the objects are in different worldspaces, return a large value (just like vanilla)
|
|
|
|