X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Fmaterial%2Fmatmodel.cxx;h=c625d9b0af0e71be2bf17e479969a5d336ba2493;hb=a050654b4cac8c4813bddfc6e376730339b678b7;hp=bdad512eef0add5bf58e2d728169a8c15b20f7ef;hpb=430c60ed1ac8d1c1ee79cdd45f6540d6dc8a5996;p=simgear.git diff --git a/simgear/scene/material/matmodel.cxx b/simgear/scene/material/matmodel.cxx index bdad512e..c625d9b0 100644 --- a/simgear/scene/material/matmodel.cxx +++ b/simgear/scene/material/matmodel.cxx @@ -139,8 +139,9 @@ SGMatModel::get_random_model( SGPropertyNode *prop_root ) { load_models( prop_root ); // comment this out if preloading models int nModels = _models.size(); - int index = int(sg_random() * nModels); - if (index >= nModels) + // int index = int(sg_random() * nModels); + static int index = -1; + if (++index >= nModels) index = 0; return _models[index].get(); }