Bug #1417: Make sure to reset all position/rotation fields when placing items

deque
scrawl 11 years ago
parent ad3a78706e
commit 0637cde267

@ -1681,6 +1681,13 @@ namespace MWWorld
MWWorld::Ptr dropped =
object.getClass().copyToCell(object, *cell, pos);
// Reset some position values that could be uninitialized if this item came from a container
LocalRotation& localRotation = dropped.getRefData().getLocalRotation();
localRotation.rot[0] = 0;
localRotation.rot[1] = 0;
localRotation.rot[2] = 0;
dropped.getCellRef().setPosition(pos);
if (mWorldScene->isCellActive(*cell)) {
if (dropped.getRefData().isEnabled()) {
mWorldScene->addObjectToScene(dropped);

Loading…
Cancel
Save