From 908732dc401ac0875e9fd3b8fb98722811569387 Mon Sep 17 00:00:00 2001 From: IrateRedKite Date: Fri, 14 Jun 2024 16:09:16 +0300 Subject: [PATCH] Duplicate position fix for Advanced Startup Solars (#424) * fix: Missing reference for global->config->solarFamilies * chore: Update Changelog.md --- CHANGELOG.md | 3 +++ plugins/advanced_startup_solars/AdvancedStartupSolars.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9d6b22a..c9049134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 4.0.31 +- Fixed a case in Advanced Startup Solars where randomly placed solars could occupy the same position + ## 4.0.30 - Adjusted the project file to ensure that Advanced Startup Solars is properly included in the build diff --git a/plugins/advanced_startup_solars/AdvancedStartupSolars.cpp b/plugins/advanced_startup_solars/AdvancedStartupSolars.cpp index 4e4bd8a3..463b4d5b 100644 --- a/plugins/advanced_startup_solars/AdvancedStartupSolars.cpp +++ b/plugins/advanced_startup_solars/AdvancedStartupSolars.cpp @@ -101,7 +101,7 @@ namespace Plugins::AdvancedStartupSolars return solarFormation; } - Position SelectSpawnLocation(SolarFamily family) + Position SelectSpawnLocation(SolarFamily& family) { auto locationIndex = RandomNumber(0, family.spawnLocations.size() - 1); @@ -178,7 +178,7 @@ namespace Plugins::AdvancedStartupSolars return; } - for (const auto& family : global->config->solarFamilies) + for (auto& family : global->config->solarFamilies) { auto dist = RandomNumber(0, 100);