Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
malytomas committed Nov 29, 2023
1 parent 9ac827b commit 90a1746
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sources/doodads.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <algorithm>
#include <tuple>

#include "planets.h"

Expand Down Expand Up @@ -208,7 +209,13 @@ namespace unnatural
loadDoodads(root, root);
CAGE_LOG(SeverityEnum::Info, "doodads", Stringizer() + "found " + doodadsDefinitions.size() + " doodads definitions");

std::sort(doodadsDefinitions.begin(), doodadsDefinitions.end(), [](const DoodadDefinition &a, const DoodadDefinition &b) { return std::tuple{ -a.priority, a.maxCount, a.chance } < std::tuple{ -b.priority, b.maxCount, a.chance }; });
std::sort(doodadsDefinitions.begin(), doodadsDefinitions.end(),
[](const DoodadDefinition &a, const DoodadDefinition &b)
{
const auto aa = std::tuple(-a.priority, a.maxCount, a.chance);
const auto bb = std::tuple(-b.priority, b.maxCount, a.chance);
return aa < bb;
});
for (DoodadDefinition &doodad : doodadsDefinitions)
placeDoodads(doodad);

Expand Down

0 comments on commit 90a1746

Please sign in to comment.