Skip to content

Commit b62551b

Browse files
added safety check for indexing when inserting the expert item into the loot list
1 parent 7d6c145 commit b62551b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

BossLogUI.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1639,8 +1639,14 @@ private void OpenLoot() {
16391639
}
16401640

16411641
// the expert item should appear after the master mode collectibles
1642-
if (GetLogEntryInfo.ExpertItem > 0 && !bossItems.Contains(GetLogEntryInfo.ExpertItem))
1643-
bossItems.Insert((int)CollectibleType.Trophy, GetLogEntryInfo.ExpertItem);
1642+
if (GetLogEntryInfo.ExpertItem > 0 && !bossItems.Contains(GetLogEntryInfo.ExpertItem)) {
1643+
if (bossItems.Count >= (int)CollectibleType.Trophy) {
1644+
bossItems.Insert((int)CollectibleType.Trophy, GetLogEntryInfo.ExpertItem);
1645+
}
1646+
else {
1647+
bossItems.Add(GetLogEntryInfo.ExpertItem);
1648+
}
1649+
}
16441650

16451651
// finally, the rest of the drops are added (including the generic collectibles)
16461652
foreach (DropRateInfo drop in bossDrops) {

0 commit comments

Comments
 (0)