X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=simgear%2Fscene%2Ftgdb%2FTreeBin.cxx;h=17da8374231b5d06fe559edf76808dc8adb3d1ca;hb=20bd0737a22eb9825fb790c9a2ac7bc2eb6ba9ae;hp=56c5d41588d3616dfc288a2d8b8dcd079a15c3d0;hpb=b3e07077fa0f29f81b4e54a61a5a10bf452b17a7;p=simgear.git diff --git a/simgear/scene/tgdb/TreeBin.cxx b/simgear/scene/tgdb/TreeBin.cxx index 56c5d415..17da8374 100644 --- a/simgear/scene/tgdb/TreeBin.cxx +++ b/simgear/scene/tgdb/TreeBin.cxx @@ -253,7 +253,7 @@ struct AddTreesLeafObject { void operator() (LOD* lod, const TreeBin::Tree& tree) const { - Geode* geode = static_cast(lod->getChild(rand() % SG_TREE_FADE_OUT_LEVELS)); + Geode* geode = static_cast(lod->getChild(int(tree.position.x() * 10.0f) % lod->getNumChildren())); addTreeToLeafGeode(geode, tree.position); } };