Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/GameLogic/MiniGames/ChaosCastleContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ protected override async ValueTask GameEndedAsync(ICollection<Player> finishers)
var sortedFinishers = finishers
.Select(this.GetGameStateOfFinisher)
.WhereNotNull()
.OrderByDescending(state => state.Score)
// Players which died stay registered until they leave the map, so the survivors must rank first.
// Otherwise a dead player with more points (e.g. from monster kills) outranks the last survivor,
// and the survivor gets the "failed" result and the rewards of a lower rank.
.OrderByDescending(state => state.Player.IsAlive)
.ThenByDescending(state => state.Score)
.ToList();

var scoreList = new List<(string Name, int Score, int BonusExp, int BonusMoney)>();
Expand Down