Skip to content

Commit

Permalink
load pwads before current wad (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
nstlaurent authored Sep 28, 2024
1 parent 8055342 commit 0ef6bd5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Core/Resources/Archives/Collection/ArchiveCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,8 @@ void ApplyWadsFromWadGameConf(string wad)
}
foreach (string pwad in originalPwads)
{
ApplyWadsFromWadGameConf(pwad);
pwads.Add(pwad);
ApplyWadsFromWadGameConf(pwad);
}

return (iwad, pwads);
Expand Down
13 changes: 12 additions & 1 deletion Tests/Unit/GameAction/Id24/GameConf.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using FluentAssertions;
using Helion.Resources.Archives.Collection;
using Helion.Resources.IWad;
using Helion.Util.Extensions;
using Helion.World.Impl.SinglePlayer;
Expand All @@ -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()
{
Expand Down

0 comments on commit 0ef6bd5

Please sign in to comment.