From 0637cde26793f984aa7b99bf23fde82950d7006e Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 13 Jun 2014 23:40:49 +0200 Subject: [PATCH] Bug #1417: Make sure to reset all position/rotation fields when placing items --- apps/openmw/mwworld/worldimp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 20a3e495e9..066cae4948 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -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);