Skip to content

Commit

Permalink
Duplicate position fix for Advanced Startup Solars (#424)
Browse files Browse the repository at this point in the history
* fix: Missing reference for global->config->solarFamilies
* chore: Update Changelog.md
  • Loading branch information
IrateRedKite authored Jun 14, 2024
1 parent 4d491d1 commit 908732d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions plugins/advanced_startup_solars/AdvancedStartupSolars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 908732d

Please sign in to comment.