From d7730c5f1dc261e0dfc55ea1b47591f0dc7697ae Mon Sep 17 00:00:00 2001 From: Karl F Date: Mon, 26 Feb 2024 14:33:11 +0100 Subject: [PATCH] fix galxyconfig --- src/GalaxyConfig.cpp | 4 +--- src/galaxy/SectorGenerator.cpp | 4 ++++ src/galaxy/SectorGenerator.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/GalaxyConfig.cpp b/src/GalaxyConfig.cpp index 01ffe3e9dea..6a5f00bd38a 100644 --- a/src/GalaxyConfig.cpp +++ b/src/GalaxyConfig.cpp @@ -3,15 +3,13 @@ #include "GalaxyConfig.h" #include "FileSystem.h" -#include "core/OS.h" GalaxyConfig::GalaxyConfig() { // set defaults std::map &map = m_map[""]; - map["Lang"] = OS::GetUserLangCode(); - map["GalaxyExploredMin"] = "65"; map["GalaxyExploredMax"] = "90"; + map["GalaxyExploredMin"] = "65"; Read(FileSystem::userFiles, "galaxy.ini"); diff --git a/src/galaxy/SectorGenerator.cpp b/src/galaxy/SectorGenerator.cpp index 1b5032149ff..310391a7bcf 100644 --- a/src/galaxy/SectorGenerator.cpp +++ b/src/galaxy/SectorGenerator.cpp @@ -15,6 +15,7 @@ #define Square(x) ((x) * (x)) GalaxyConfig *SectorCustomSystemsGenerator::galaxyConfig; +GalaxyConfig *SectorRandomSystemsGenerator::galaxyConfig; bool SectorCustomSystemsGenerator::Apply(Random &rng, RefCountedPtr galaxy, RefCountedPtr sector, GalaxyGenerator::SectorConfig *config) { @@ -171,6 +172,9 @@ bool SectorRandomSystemsGenerator::Apply(Random &rng, RefCountedPtr gala s.m_pos.y = rng.Double(Sector::SIZE); s.m_pos.z = rng.Double(Sector::SIZE); + int GalaxyExploredMax = (SectorRandomSystemsGenerator::galaxyConfig->Int("GalaxyExploredMax")); + int GalaxyExploredMin = (SectorRandomSystemsGenerator::galaxyConfig->Int("GalaxyExploredMin")); + /* * 0 - ~500ly from sol: explored * ~500ly - ~700ly (65-90 sectors): gradual diff --git a/src/galaxy/SectorGenerator.h b/src/galaxy/SectorGenerator.h index f9ba4baaede..13b7a0381c3 100644 --- a/src/galaxy/SectorGenerator.h +++ b/src/galaxy/SectorGenerator.h @@ -33,6 +33,7 @@ class SectorRandomSystemsGenerator : public SectorGeneratorStage { private: const std::string GenName(RefCountedPtr galaxy, const Sector &sec, Sector::System &sys, int si, Random &rand); + static GalaxyConfig *galaxyConfig; }; class SectorPersistenceGenerator : public SectorGeneratorStage {