Skip to content

Commit

Permalink
Sort random upgrades by UpgradeKind
Browse files Browse the repository at this point in the history
  • Loading branch information
necrashter committed Dec 8, 2023
1 parent ab076ba commit 2c917a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ impl UpgradeSequence {
.copied()
.collect::<Vec<_>>();

upgrades.sort();

// Add an upgrade that refreshes the upgrade list to reduce the dependency on luck.
upgrades.push(UpgradeKind::BrainstormAgain);

Expand Down Expand Up @@ -346,7 +348,7 @@ fn load_upgrade_sequence(mut commands: Commands) {
macro_rules! generate_upgrade_list {
(|$world:ident| $($enumname:ident: $upgrade:expr),+ $(,)?) => {
/// Enum containing all upgrade types.
#[derive(Reflect, Clone, Copy, PartialEq, Eq, Hash, EnumCount, Debug)]
#[derive(Reflect, Clone, Copy, PartialEq, Eq, Hash, EnumCount, Debug, PartialOrd, Ord)]
pub enum UpgradeKind {
$($enumname),+
}
Expand Down

0 comments on commit 2c917a2

Please sign in to comment.