Skip to content

Commit

Permalink
Fix map data processor crash when duplicate berry ID appears before a…
Browse files Browse the repository at this point in the history
…ny with ID -1
  • Loading branch information
Kalobi authored and coloursofnoise committed Dec 16, 2022
1 parent 4e753ad commit 491f999
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Celeste.Mod.mm/Mod/Core/CoreMapDataProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ public override void Reset() {
}
if (PlacedBerriesPerCheckpoint[checkpoint].ContainsKey(order)) {
Logger.Log(LogLevel.Warn, "core", $"Duplicate berry order {order} in checkpoint {checkpoint} of map {Mode.Path}. Reassigning berry order.");
if (!AutomaticBerriesPerCheckpoint.ContainsKey(checkpoint)) {
AutomaticBerriesPerCheckpoint[checkpoint] = new List<BinaryPacker.Element>();
}
AutomaticBerriesPerCheckpoint[checkpoint].Add(entity); // treat duplicate order as -1
} else {
PlacedBerriesPerCheckpoint[checkpoint][order] = entity;
Expand Down

0 comments on commit 491f999

Please sign in to comment.