mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 22:15:32 +00:00
PlaceItem, PlaceItemCell: Make sure references are placed above terrain (Bug #2078)
This commit is contained in:
parent
886903d70e
commit
7892ed35f3
1 changed files with 4 additions and 2 deletions
|
@ -433,7 +433,8 @@ namespace MWScript
|
||||||
pos.rot[2] = zRot;
|
pos.rot[2] = zRot;
|
||||||
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(),itemID);
|
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(),itemID);
|
||||||
ref.getPtr().getCellRef().setPosition(pos);
|
ref.getPtr().getCellRef().setPosition(pos);
|
||||||
MWBase::Environment::get().getWorld()->safePlaceObject(ref.getPtr(),store,pos);
|
MWWorld::Ptr placed = MWBase::Environment::get().getWorld()->safePlaceObject(ref.getPtr(),store,pos);
|
||||||
|
placed.getClass().adjustPosition(placed, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -480,7 +481,8 @@ namespace MWScript
|
||||||
pos.rot[2] = zRot;
|
pos.rot[2] = zRot;
|
||||||
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(),itemID);
|
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(),itemID);
|
||||||
ref.getPtr().getCellRef().setPosition(pos);
|
ref.getPtr().getCellRef().setPosition(pos);
|
||||||
MWBase::Environment::get().getWorld()->safePlaceObject(ref.getPtr(),store,pos);
|
MWWorld::Ptr placed = MWBase::Environment::get().getWorld()->safePlaceObject(ref.getPtr(),store,pos);
|
||||||
|
placed.getClass().adjustPosition(placed, true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue