From a314f196eb792e3f1bcb90f8ec40a287c9192d19 Mon Sep 17 00:00:00 2001 From: fredzio Date: Sat, 12 Dec 2020 18:02:46 +0100 Subject: [PATCH] Unconditionally call actor->resetPosition in adjustPosition. Revert broken change that would force adjust all actors in cell upon loading. That break floating corpses (and probably others things). --- apps/openmw/mwworld/scene.cpp | 2 +- apps/openmw/mwworld/worldimp.cpp | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 631253bd4..47b62862f 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -253,7 +253,7 @@ namespace bool operator() (const MWWorld::Ptr& ptr) { if (!ptr.getRefData().isDeleted() && ptr.getRefData().isEnabled()) - ptr.getClass().adjustPosition (ptr, true); + ptr.getClass().adjustPosition (ptr, false); return true; } }; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index c24597b84..f59c92c6a 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1344,12 +1344,8 @@ namespace MWWorld } moveObject(ptr, ptr.getCell(), pos.x(), pos.y(), pos.z()); - if (force) // force physics to use the new position - { - auto actor = mPhysics->getActor(ptr); - if(actor) - actor->resetPosition(); - } + if (ptr.getClass().isActor()) + mPhysics->getActor(ptr)->resetPosition(); } void World::fixPosition()