Skip to content

Commit

Permalink
Add ToArray to PatchAiCalc enumeration
Browse files Browse the repository at this point in the history
  • Loading branch information
AnimatedSwine37 committed Aug 10, 2023
1 parent de40bd8 commit 357fafe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion p5rpc.modloader/Merging/Tbl/P3PTblMerger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ private async Task<byte[]> PatchMsgTable(byte[] extractedTable, List<string> can
private async Task<byte[]> PatchAiCalc(byte[] extractedTable, List<string> candidates)
{
var bfs = new byte[18][];
// ToArray so we can remove items from the collection in the foreach
var bfFiles = candidates.Where(x =>
x.EndsWith("enemy.bf", StringComparison.OrdinalIgnoreCase) ||
x.EndsWith("friend.bf", StringComparison.OrdinalIgnoreCase));
x.EndsWith("friend.bf", StringComparison.OrdinalIgnoreCase)).ToArray();
foreach (var bfFile in bfFiles)
{
_logger.Info($"Embedding {bfFile} into AICALC.TBL");
Expand Down
3 changes: 2 additions & 1 deletion p5rpc.modloader/Merging/Tbl/P4GTblMerger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ private async Task<byte[]> PatchMsgTable(byte[] extractedTable, List<string> can
private async Task<byte[]> PatchAiCalc(byte[] extractedTable, List<string> candidates)
{
var bfs = new byte[11][];
// ToArray so we can remove items from the collection in the foreach
var bfFiles = candidates.Where(x =>
x.EndsWith("enemy.bf", StringComparison.OrdinalIgnoreCase) ||
x.EndsWith("friend.bf", StringComparison.OrdinalIgnoreCase));
x.EndsWith("friend.bf", StringComparison.OrdinalIgnoreCase)).ToArray();
foreach (var bfFile in bfFiles)
{
_logger.Info($"Embedding {bfFile} into AICALC.TBL");
Expand Down

0 comments on commit 357fafe

Please sign in to comment.