forked from mirror/openmw-tes3mp
Don't set an underwater environment when there's no water
This commit is contained in:
parent
54ce95cfaf
commit
2147210ad7
1 changed files with 2 additions and 2 deletions
|
@ -407,7 +407,7 @@ namespace MWSound
|
||||||
if(!isMusicPlaying())
|
if(!isMusicPlaying())
|
||||||
startRandomTitle();
|
startRandomTitle();
|
||||||
|
|
||||||
MWWorld::Ptr::CellStore *current = mEnvironment.mWorld->getPlayer().getPlayer().getCell();
|
const ESM::Cell *cell = mEnvironment.mWorld->getPlayer().getPlayer().getCell()->cell;
|
||||||
Ogre::Camera *cam = mEnvironment.mWorld->getPlayer().getRenderer()->getCamera();
|
Ogre::Camera *cam = mEnvironment.mWorld->getPlayer().getRenderer()->getCamera();
|
||||||
Ogre::Vector3 nPos, nDir, nUp;
|
Ogre::Vector3 nPos, nDir, nUp;
|
||||||
nPos = cam->getRealPosition();
|
nPos = cam->getRealPosition();
|
||||||
|
@ -415,7 +415,7 @@ namespace MWSound
|
||||||
nUp = cam->getRealUp();
|
nUp = cam->getRealUp();
|
||||||
|
|
||||||
Environment env = Env_Normal;
|
Environment env = Env_Normal;
|
||||||
if(nPos.y < current->cell->water)
|
if((cell->data.flags&cell->HasWater) && nPos.y < cell->water)
|
||||||
env = Env_Underwater;
|
env = Env_Underwater;
|
||||||
|
|
||||||
// The output handler is expecting vectors oriented like the game
|
// The output handler is expecting vectors oriented like the game
|
||||||
|
|
Loading…
Reference in a new issue