Skip to content

Commit

Permalink
Prevent exception when checking active inventions for country (#1888)…
Browse files Browse the repository at this point in the history
… #patch

Sentry event ID: d7bdc511483a459c83214012a1fb3f9b
  • Loading branch information
IhateTrains authored Apr 20, 2024
1 parent c6cee6d commit ddcffcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ImperatorToCK3/Imperator/Inventions/InventionsDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void LoadInventions(ModFilesystem irModFS) {
public IEnumerable<string> GetActiveInventionIds(IList<bool> booleans) {
// Enumerate over the inventions and return the ones that are active (bool is true).
foreach (var item in inventionIds.Select((inventionId, i) => new { i, inventionId })) {
if (booleans[item.i]) {
if (item.i < booleans.Count && booleans[item.i]) {
yield return item.inventionId;
}
}
Expand Down

0 comments on commit ddcffcc

Please sign in to comment.