forked from mirror/openmw-tes3mp
Bug #1417: Make sure to reset all position/rotation fields when placing items
This commit is contained in:
parent
ad3a78706e
commit
0637cde267
1 changed files with 7 additions and 0 deletions
|
@ -1681,6 +1681,13 @@ namespace MWWorld
|
||||||
MWWorld::Ptr dropped =
|
MWWorld::Ptr dropped =
|
||||||
object.getClass().copyToCell(object, *cell, pos);
|
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 (mWorldScene->isCellActive(*cell)) {
|
||||||
if (dropped.getRefData().isEnabled()) {
|
if (dropped.getRefData().isEnabled()) {
|
||||||
mWorldScene->addObjectToScene(dropped);
|
mWorldScene->addObjectToScene(dropped);
|
||||||
|
|
Loading…
Reference in a new issue