diff --git a/sc2/src/uqm/planets/generate-base.cpp b/sc2/src/uqm/planets/generate-base.cpp index 0c800f08e..d3bc96d27 100644 --- a/sc2/src/uqm/planets/generate-base.cpp +++ b/sc2/src/uqm/planets/generate-base.cpp @@ -235,6 +235,8 @@ namespace Planets ::detail:: Generate_m void validateAllStars() { + std::cerr << "Checking if any stars are out of required sorting order..." + << std::endl; const auto where= std::is_sorted_until( GetAllStars(), GetAllStars() + GetStarCount(), []( const auto &lhs_, const auto &rhs_ ) @@ -283,6 +285,15 @@ namespace Planets ::detail:: Generate_m gen->checkSupplementRequirements( star.supArg ? star.supArg : std::optional< std::string >{} ); } } + + void + stickyValidateAllStars() + { + static bool validated= false; + if( validated ) return; + validateAllStars(); + validated= true; + } } } @@ -297,7 +308,7 @@ extern "C" void SetupGeneratorForSolarSystem( STAR_DESC *const desc, SolarSystem *const solarSys ) { - if( C::debugGenerationByValidatingAllStars ) validateAllStars(); + if( C::debugGenerationByValidatingAllStars ) stickyValidateAllStars(); // Must either have a legacy constructor or a named lookup, // but not both.