Skip to content

Commit c6a85aa

Browse files
committed
Set Main.rand within server init test
Avoiding the use of DedServ.
1 parent 0c9f2f7 commit c6a85aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

TerrariaServerAPI.Tests/BaseTest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using NUnit.Framework;
22
using System.Runtime.InteropServices;
3+
using Terraria.Utilities;
34

45
namespace TerrariaServerAPI.Tests;
56

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

0 commit comments

Comments
 (0)