diff --git a/CHANGELOG.md b/CHANGELOG.md index e3c2ab85e0..77c06bd2d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -203,7 +203,6 @@ Bug #5269: Editor: Cell lighting in resaved cleaned content files is corrupted Bug #5278: Console command Show doesn't fall back to global variable after local var not found Bug #5300: NPCs don't switch from torch to shield when starting combat - Feature #1415: Infinite fall failsafe Feature #1774: Handle AvoidNode Feature #2229: Improve pathfinding AI Feature #3025: Analogue gamepad movement controls diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 7c46a2fc75..a366f9a75b 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -33,7 +33,6 @@ #include "../mwphysics/object.hpp" #include "../mwphysics/heightfield.hpp" -#include "actionteleport.hpp" #include "player.hpp" #include "localscripts.hpp" #include "esmstore.hpp" @@ -258,20 +257,10 @@ namespace struct PositionVisitor { - float mLowestPos = std::numeric_limits::max(); - bool operator() (const MWWorld::Ptr& ptr) { if (!ptr.getRefData().isDeleted() && ptr.getRefData().isEnabled()) - { - if (!ptr.getClass().isActor()) - { - float objectPosZ = ptr.getRefData().getPosition().pos[2]; - if (objectPosZ < mLowestPos) - mLowestPos = objectPosZ; - } ptr.getClass().adjustPosition (ptr, false); - } return true; } }; @@ -498,16 +487,6 @@ namespace MWWorld const auto player = MWBase::Environment::get().getWorld()->getPlayerPtr(); navigator->update(player.getRefData().getPosition().asVec3()); - const float fallThreshold = 256.f; - if (mCurrentCell && !mCurrentCell->isExterior() && pos.z() < mLowestPos - fallThreshold) - { - ESM::Position newPos; - std::string cellName = mCurrentCell->getCell()->mName; - MWBase::Environment::get().getWorld()->findInteriorPosition(cellName, newPos); - if (newPos.pos[2] >= mLowestPos) - MWWorld::ActionTeleport(cellName, newPos, false).execute(player); - } - if (!mCurrentCell || !mCurrentCell->isExterior()) return; @@ -898,10 +877,8 @@ namespace MWWorld insertVisitor.insert([&] (const MWWorld::Ptr& ptr) { addObject(ptr, *mPhysics, mNavigator); }); // do adjustPosition (snapping actors to ground) after objects are loaded, so we don't depend on the loading order - // Also note the lowest object position in the cell to allow infinite fall fail safe to work PositionVisitor posVisitor; cell.forEach (posVisitor); - mLowestPos = posVisitor.mLowestPos; } void Scene::addObjectToScene (const Ptr& ptr) diff --git a/apps/openmw/mwworld/scene.hpp b/apps/openmw/mwworld/scene.hpp index c08c5c163a..da795f84b7 100644 --- a/apps/openmw/mwworld/scene.hpp +++ b/apps/openmw/mwworld/scene.hpp @@ -84,7 +84,6 @@ namespace MWWorld float mPredictionTime; osg::Vec3f mLastPlayerPos; - float mLowestPos; void insertCell (CellStore &cell, Loading::Listener* loadingListener, bool test = false);