Don't set an underwater environment when there's no water

actorid
Chris Robinson 13 years ago
parent 54ce95cfaf
commit 2147210ad7

@ -407,7 +407,7 @@ namespace MWSound
if(!isMusicPlaying())
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::Vector3 nPos, nDir, nUp;
nPos = cam->getRealPosition();
@ -415,7 +415,7 @@ namespace MWSound
nUp = cam->getRealUp();
Environment env = Env_Normal;
if(nPos.y < current->cell->water)
if((cell->data.flags&cell->HasWater) && nPos.y < cell->water)
env = Env_Underwater;
// The output handler is expecting vectors oriented like the game

Loading…
Cancel
Save