Levels are mirrored when traveling backwards through a connection in the campaign mode. Closes #519

This commit is contained in:
Joonas Rikkonen
2018-08-08 15:30:32 +03:00
parent 99c76d0099
commit 5100956bae
5 changed files with 18 additions and 10 deletions
@@ -182,7 +182,7 @@ namespace Barotrauma
StartRound(randomLevel, true, loadSecondSub);
}
public void StartRound(Level level, bool reloadSub = true, bool loadSecondSub = false)
public void StartRound(Level level, bool reloadSub = true, bool loadSecondSub = false, bool mirrorLevel = false)
{
#if CLIENT
GameMain.LightManager.LosEnabled = GameMain.NetworkMember == null || GameMain.NetworkMember.CharacterInfo != null;
@@ -210,11 +210,10 @@ namespace Barotrauma
Submarine.MainSubs[1].Load(false);
}
}
if (level != null)
{
level.Generate();
level.Generate(mirrorLevel);
submarine.SetPosition(submarine.FindSpawnPos(level.StartPosition - new Vector2(0.0f, 2000.0f)));
}
@@ -229,9 +228,9 @@ namespace Barotrauma
if (GameMode != null)
{
GameMode.MsgBox();
if (GameMode is MultiPlayerCampaign campaign && GameMain.Server != null)
if (GameMode is MultiPlayerCampaign mpCampaign && GameMain.Server != null)
{
campaign.CargoManager.CreateItems();
mpCampaign.CargoManager.CreateItems();
}
}