Skip to content

Commit

Permalink
Set Main.rand within server init test
Browse files Browse the repository at this point in the history
Avoiding the use of DedServ.
  • Loading branch information
SignatureBeef committed Jan 4, 2025
1 parent 0c9f2f7 commit c6a85aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion TerrariaServerAPI.Tests/BaseTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using NUnit.Framework;
using System.Runtime.InteropServices;
using Terraria.Utilities;

namespace TerrariaServerAPI.Tests;

Expand All @@ -20,7 +21,8 @@ public void EnsureInitialised()
invoked = true;
// DedServ typically requires input, so no need to continue execution
args.ContinueExecution = false;
// DedServ calls the following method, which is needed for subsequent tests
// DedServ calls the following, which is needed for subsequent tests
global::Terraria.Main.rand = new UnifiedRandom();
instance.Initialize();
};
HookEvents.Terraria.Main.DedServ += cb;
Expand Down

0 comments on commit c6a85aa

Please sign in to comment.