mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 05:23:51 +00:00
Merge pull request #2711 from Capostrophic/failsafe
Revert infinite fall failsafe addition
This commit is contained in:
commit
8442446080
3 changed files with 0 additions and 25 deletions
|
@ -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
|
||||
|
|
|
@ -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<float>::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)
|
||||
|
|
|
@ -84,7 +84,6 @@ namespace MWWorld
|
|||
float mPredictionTime;
|
||||
|
||||
osg::Vec3f mLastPlayerPos;
|
||||
float mLowestPos;
|
||||
|
||||
void insertCell (CellStore &cell, Loading::Listener* loadingListener, bool test = false);
|
||||
|
||||
|
|
Loading…
Reference in a new issue