diff --git a/src/SimulationModel.cpp b/src/SimulationModel.cpp index 6b8169da8..6efd6a4b6 100644 --- a/src/SimulationModel.cpp +++ b/src/SimulationModel.cpp @@ -156,13 +156,6 @@ SimulationModel::SimulationModel(irr::IrrlichtDevice* dev, ownShip.setSpeed(0); //Don't start moving if in secondary mode } - //add water - bool waterReflection = true; - if (modelParameters.vrMode == true) { - waterReflection = false; - } - water.load(smgr,ownShip.getSceneNode(),weather,modelParameters.disableShaders,waterReflection,modelParameters.waterSegments); - /* To be replaced by getting information and passing into gui load method. //Tell gui to hide the second engine scroll bar if we have a single engine if (ownShip.isSingleEngine()) { @@ -262,6 +255,14 @@ SimulationModel::SimulationModel(irr::IrrlichtDevice* dev, //Hide the man overboard model manOverboard.setVisible(false); + //add water + // Note that water.load resets the srand() seed to a fixed value. + bool waterReflection = true; + if (modelParameters.vrMode == true) { + waterReflection = false; + } + water.load(smgr,ownShip.getSceneNode(),weather,modelParameters.disableShaders,waterReflection,modelParameters.waterSegments); + //initialise offset offsetPosition = irr::core::vector3d(0,0,0); diff --git a/src/main.cpp b/src/main.cpp index 8e6677bc8..1500512f4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -885,7 +885,8 @@ int main(int argc, char ** argv) driver->endScene(); //seed random number generator - std::srand(device->getTimer()->getTime()); + std::srand(device->getTimer()->getRealTime()); + // Note that this gets reset to a constant seed in water.load() in SimulationModel constructor. //create GUI GUIMain guiMain;