Fixed entity IDs getting messed up and causing desync because of purchased items in multiplayer campaign. The server created cargo items first and then mission-related entities, while the clients only spawned mission entities and relied on the server to spawn the cargo, which caused mission entities to have wrong IDs. Closes #484

This commit is contained in:
Joonas Rikkonen
2018-07-17 12:50:04 +03:00
parent dcb48e56d4
commit 88abbe28e3
4 changed files with 32 additions and 11 deletions
@@ -226,7 +226,14 @@ namespace Barotrauma
EventManager.StartRound(level);
if (GameMode != null) GameMode.MsgBox();
if (GameMode != null)
{
GameMode.MsgBox();
if (GameMode is MultiPlayerCampaign campaign && GameMain.Server != null)
{
campaign.CargoManager.CreateItems();
}
}
if (GameSettings.SendUserStatistics)
{
@@ -234,7 +241,7 @@ namespace Barotrauma
GameAnalyticsSDK.Net.GameAnalytics.AddProgressionEvent(GameAnalyticsSDK.Net.EGAProgressionStatus.Start,
GameMode.Name, (Mission == null ? "None" : Mission.GetType().ToString()));
}
#if CLIENT
roundSummary = new RoundSummary(this);