Skip to content

Commit

Permalink
fix universeObserveLevel offset
Browse files Browse the repository at this point in the history
the valid range is 0-4 so we don't need to subtract 1 from the last digit.
  • Loading branch information
PhantomGamers committed Jan 15, 2022
1 parent 99d9f68 commit acf72f1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 0 additions & 2 deletions NebulaNetwork/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ public override void Start()
Config.Options.GetMechaColors(),
!string.IsNullOrWhiteSpace(Config.Options.Nickname) ? Config.Options.Nickname : GameMain.data.account.userName), loadSaveFile);


GameMain.history.universeObserveLevel = SimulatedWorld.GetUniverseObserveLevel();
NebulaModAPI.OnMultiplayerGameStarted?.Invoke();
}

Expand Down
2 changes: 1 addition & 1 deletion NebulaPatcher/Patches/Dynamic/UIPlanetDetail_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static bool OnPlanetDataSet_Prefix(UIPlanetDetail __instance)
{
if(Multiplayer.IsActive && Multiplayer.Session.IsInLobby)
{
GameMain.history.universeObserveLevel = 3;
GameMain.history.universeObserveLevel = 4;
}
return true;
}
Expand Down
5 changes: 5 additions & 0 deletions NebulaWorld/MultiplayerSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ public void OnGameLoadCompleted()
Log.Info("Game load completed");
IsGameLoaded = true;

if (Multiplayer.Session.LocalPlayer.IsHost)
{
GameMain.history.universeObserveLevel = SimulatedWorld.GetUniverseObserveLevel();
}

if (Multiplayer.Session.LocalPlayer.IsInitialDataReceived)
{
Multiplayer.Session.World.SetupInitialPlayerState();
Expand Down
4 changes: 2 additions & 2 deletions NebulaWorld/SimulatedWorld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,8 @@ public static int GetUniverseObserveLevel()
{
if (GameMain.history.TechUnlocked(i))
{
// set level to last digit of tech id - 1
level = (i % 10) - 1;
// set level to last digit of tech id
level = (i % 10);
break;
}
}
Expand Down

0 comments on commit acf72f1

Please sign in to comment.