From 0ef6bd5cca1e69f6c91f87f006c9157a64e4f311 Mon Sep 17 00:00:00 2001 From: Nick <42744211+nstlaurent@users.noreply.github.com> Date: Sat, 28 Sep 2024 02:55:21 -0700 Subject: [PATCH] load pwads before current wad (#767) --- .../Archives/Collection/ArchiveCollection.cs | 2 +- Tests/Unit/GameAction/Id24/GameConf.cs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Core/Resources/Archives/Collection/ArchiveCollection.cs b/Core/Resources/Archives/Collection/ArchiveCollection.cs index f79529317..395080865 100644 --- a/Core/Resources/Archives/Collection/ArchiveCollection.cs +++ b/Core/Resources/Archives/Collection/ArchiveCollection.cs @@ -659,8 +659,8 @@ void ApplyWadsFromWadGameConf(string wad) } foreach (string pwad in originalPwads) { - ApplyWadsFromWadGameConf(pwad); pwads.Add(pwad); + ApplyWadsFromWadGameConf(pwad); } return (iwad, pwads); diff --git a/Tests/Unit/GameAction/Id24/GameConf.cs b/Tests/Unit/GameAction/Id24/GameConf.cs index 60aa6e55e..963f44370 100644 --- a/Tests/Unit/GameAction/Id24/GameConf.cs +++ b/Tests/Unit/GameAction/Id24/GameConf.cs @@ -1,5 +1,4 @@ using FluentAssertions; -using Helion.Resources.Archives.Collection; using Helion.Resources.IWad; using Helion.Util.Extensions; using Helion.World.Impl.SinglePlayer; @@ -18,6 +17,18 @@ public GameConf() World = WorldAllocator.LoadMap("Resources/id24gameconf.zip", "id24gameconf.wad", "MAP01", GetType().Name, (world) => { }, IWadType.Doom2, gameConf: true); } + [Fact(DisplayName = "Pwad load order")] + public void Pwads() + { + var archives = World.ArchiveCollection.AllArchives.ToArray(); + archives.Length.Should().Be(5); + archives[0].Path.Name.ToLower().Should().Be("assets"); + archives[1].Path.Name.ToLower().Should().Be("doom2"); + archives[2].Path.Name.ToLower().Should().Be("id24gameconf"); + archives[3].Path.Name.ToLower().Should().Be("pwad1"); + archives[4].Path.Name.ToLower().Should().Be("pwad2"); + } + [Fact(DisplayName = "Wad translation")] public void WadTranslation() {