mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 09:23:53 +00:00
Fix setWaterLevel script instruction not affecting physics
This commit is contained in:
parent
01e32aef79
commit
ad8790fba0
2 changed files with 6 additions and 6 deletions
|
@ -723,9 +723,9 @@ namespace MWSound
|
||||||
|
|
||||||
MWWorld::Ptr player =
|
MWWorld::Ptr player =
|
||||||
MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
const ESM::Cell *cell = player.getCell()->getCell();
|
const MWWorld::CellStore *cell = player.getCell();
|
||||||
|
|
||||||
mListenerUnderwater = ((cell->mData.mFlags&cell->HasWater) && mListenerPos.z < cell->mWater);
|
mListenerUnderwater = ((cell->getCell()->mData.mFlags&ESM::Cell::HasWater) && mListenerPos.z < cell->getWaterLevel());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundManager::updatePtr(const MWWorld::Ptr &old, const MWWorld::Ptr &updated)
|
void SoundManager::updatePtr(const MWWorld::Ptr &old, const MWWorld::Ptr &updated)
|
||||||
|
|
|
@ -862,9 +862,9 @@ namespace MWWorld
|
||||||
for(;iter != mMovementQueue.end();++iter)
|
for(;iter != mMovementQueue.end();++iter)
|
||||||
{
|
{
|
||||||
float waterlevel = -std::numeric_limits<float>::max();
|
float waterlevel = -std::numeric_limits<float>::max();
|
||||||
const ESM::Cell *cell = iter->first.getCell()->getCell();
|
const MWWorld::CellStore *cell = iter->first.getCell();
|
||||||
if(cell->hasWater())
|
if(cell->getCell()->hasWater())
|
||||||
waterlevel = cell->mWater;
|
waterlevel = cell->getWaterLevel();
|
||||||
|
|
||||||
float oldHeight = iter->first.getRefData().getPosition().pos[2];
|
float oldHeight = iter->first.getRefData().getPosition().pos[2];
|
||||||
|
|
||||||
|
@ -872,7 +872,7 @@ namespace MWWorld
|
||||||
|
|
||||||
bool waterCollision = false;
|
bool waterCollision = false;
|
||||||
if (effects.get(ESM::MagicEffect::WaterWalking).getMagnitude()
|
if (effects.get(ESM::MagicEffect::WaterWalking).getMagnitude()
|
||||||
&& cell->hasWater()
|
&& cell->getCell()->hasWater()
|
||||||
&& !world->isUnderwater(iter->first.getCell(),
|
&& !world->isUnderwater(iter->first.getCell(),
|
||||||
Ogre::Vector3(iter->first.getRefData().getPosition().pos)))
|
Ogre::Vector3(iter->first.getRefData().getPosition().pos)))
|
||||||
waterCollision = true;
|
waterCollision = true;
|
||||||
|
|
Loading…
Reference in a new issue