mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
PlaceAt: Copy the rotation when placing a non-actor. Don't modify placement position by bounding box for non-actors. Fixes placement in Graphic Herbalism mod.
This commit is contained in:
parent
0e267b79ec
commit
bb4bd999ba
2 changed files with 22 additions and 9 deletions
|
@ -490,10 +490,20 @@ namespace MWScript
|
|||
ipos.pos[0] = pos.x;
|
||||
ipos.pos[1] = pos.y;
|
||||
ipos.pos[2] = pos.z;
|
||||
ipos.rot[0] = 0;
|
||||
ipos.rot[1] = 0;
|
||||
ipos.rot[2] = 0;
|
||||
|
||||
if (actor.getClass().isActor())
|
||||
{
|
||||
// TODO: should this depend on the 'direction' parameter?
|
||||
ipos.rot[0] = 0;
|
||||
ipos.rot[1] = 0;
|
||||
ipos.rot[2] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ipos.rot[0] = actor.getRefData().getPosition().rot[0];
|
||||
ipos.rot[1] = actor.getRefData().getPosition().rot[1];
|
||||
ipos.rot[2] = actor.getRefData().getPosition().rot[2];
|
||||
}
|
||||
// create item
|
||||
MWWorld::CellStore* store = actor.getCell();
|
||||
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), itemID, count);
|
||||
|
|
|
@ -1543,12 +1543,15 @@ namespace MWWorld
|
|||
MWWorld::Ptr dropped =
|
||||
MWWorld::Class::get(object).copyToCell(object, cell, pos);
|
||||
|
||||
Ogre::Vector3 min, max;
|
||||
if (mPhysics->getObjectAABB(object, min, max)) {
|
||||
float *pos = dropped.getRefData().getPosition().pos;
|
||||
pos[0] -= (min.x + max.x) / 2;
|
||||
pos[1] -= (min.y + max.y) / 2;
|
||||
pos[2] -= min.z;
|
||||
if (object.getClass().isActor())
|
||||
{
|
||||
Ogre::Vector3 min, max;
|
||||
if (mPhysics->getObjectAABB(object, min, max)) {
|
||||
float *pos = dropped.getRefData().getPosition().pos;
|
||||
pos[0] -= (min.x + max.x) / 2;
|
||||
pos[1] -= (min.y + max.y) / 2;
|
||||
pos[2] -= min.z;
|
||||
}
|
||||
}
|
||||
|
||||
if (mWorldScene->isCellActive(cell)) {
|
||||
|
|
Loading…
Reference in a new issue