Skip to content

Commit

Permalink
(temp) fix for the WarningSystem NRE caused by clients leaving the so…
Browse files Browse the repository at this point in the history
…lar system
  • Loading branch information
sp00ktober committed Nov 18, 2021
1 parent 23e19c5 commit d3a7446
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions NebulaPatcher/Patches/Dynamic/GameData_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ public static void LeaveStar_Prefix(GameData __instance)
}
}
}
// we need to reset the warning system to avoid nre for clients when they leave the solar system. this is related to the new traffic monitor
// as we also free factory data this should be fine.
// warnings should be triggered by some other syncing mechanic issued by the host (or find a better solution for this if you are not so tired as i am now)
GameMain.data.warningSystem.Free();
GameMain.data.warningSystem.Init(GameMain.data);
}
Multiplayer.Session.Network.SendPacket(new PlayerUpdateLocalStarId(-1));
}
Expand Down

0 comments on commit d3a7446

Please sign in to comment.