mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +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[0] = pos.x;
|
||||||
ipos.pos[1] = pos.y;
|
ipos.pos[1] = pos.y;
|
||||||
ipos.pos[2] = pos.z;
|
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
|
// create item
|
||||||
MWWorld::CellStore* store = actor.getCell();
|
MWWorld::CellStore* store = actor.getCell();
|
||||||
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), itemID, count);
|
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), itemID, count);
|
||||||
|
|
|
@ -1543,12 +1543,15 @@ namespace MWWorld
|
||||||
MWWorld::Ptr dropped =
|
MWWorld::Ptr dropped =
|
||||||
MWWorld::Class::get(object).copyToCell(object, cell, pos);
|
MWWorld::Class::get(object).copyToCell(object, cell, pos);
|
||||||
|
|
||||||
Ogre::Vector3 min, max;
|
if (object.getClass().isActor())
|
||||||
if (mPhysics->getObjectAABB(object, min, max)) {
|
{
|
||||||
float *pos = dropped.getRefData().getPosition().pos;
|
Ogre::Vector3 min, max;
|
||||||
pos[0] -= (min.x + max.x) / 2;
|
if (mPhysics->getObjectAABB(object, min, max)) {
|
||||||
pos[1] -= (min.y + max.y) / 2;
|
float *pos = dropped.getRefData().getPosition().pos;
|
||||||
pos[2] -= min.z;
|
pos[0] -= (min.x + max.x) / 2;
|
||||||
|
pos[1] -= (min.y + max.y) / 2;
|
||||||
|
pos[2] -= min.z;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mWorldScene->isCellActive(cell)) {
|
if (mWorldScene->isCellActive(cell)) {
|
||||||
|
|
Loading…
Reference in a new issue