|
|
|
@ -518,10 +518,8 @@ namespace MWScript
|
|
|
|
|
if (count<0)
|
|
|
|
|
throw std::runtime_error ("count must be non-negative");
|
|
|
|
|
|
|
|
|
|
// no-op
|
|
|
|
|
if (count == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<count; ++i)
|
|
|
|
|
{
|
|
|
|
|
ESM::Position ipos = actor.getRefData().getPosition();
|
|
|
|
|
Ogre::Vector3 pos(ipos.pos[0],ipos.pos[1],ipos.pos[2]);
|
|
|
|
|
Ogre::Quaternion rot(Ogre::Radian(-ipos.rot[2]), Ogre::Vector3::UNIT_Z);
|
|
|
|
@ -550,11 +548,12 @@ namespace MWScript
|
|
|
|
|
}
|
|
|
|
|
// create item
|
|
|
|
|
MWWorld::CellStore* store = actor.getCell();
|
|
|
|
|
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), itemID, count);
|
|
|
|
|
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), itemID, 1);
|
|
|
|
|
ref.getPtr().getCellRef().setPosition(ipos);
|
|
|
|
|
|
|
|
|
|
MWBase::Environment::get().getWorld()->safePlaceObject(ref.getPtr(),store,ipos);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<class R>
|
|
|
|
|