Merge remote-tracking branch 'upstream/master' into develop
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
#nullable enable
|
||||
|
||||
using Barotrauma.Extensions;
|
||||
using Barotrauma.IO;
|
||||
using Barotrauma.Items.Components;
|
||||
using Barotrauma.Networking;
|
||||
using Barotrauma.PerkBehaviors;
|
||||
using FarseerPhysics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.Networking;
|
||||
using Barotrauma.Extensions;
|
||||
using Barotrauma.PerkBehaviors;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -953,14 +954,6 @@ namespace Barotrauma
|
||||
sub.SetPosition(spawnPos);
|
||||
myPort.Dock(outPostPort);
|
||||
myPort.Lock(isNetworkMessage: true, applyEffects: false);
|
||||
foreach (var item in sub.GetItems(alsoFromConnectedSubs: true))
|
||||
{
|
||||
//need to refresh position to maintain since the sub was moved to the docking port
|
||||
if (item.GetComponent<Steering>() is { MaintainPos: true } steering)
|
||||
{
|
||||
steering.RefreshPosToMaintain();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -983,6 +976,16 @@ namespace Barotrauma
|
||||
sub.EnableMaintainPosition();
|
||||
}
|
||||
|
||||
foreach (var item in sub.GetItems(alsoFromConnectedSubs: true))
|
||||
{
|
||||
// Refresh pos to maintain in all steering components maintaining
|
||||
// position, including ones in shuttles, since the submarines moved
|
||||
if (item.GetComponent<Steering>() is { MaintainPos: true } steering)
|
||||
{
|
||||
steering.RefreshPosToMaintain();
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure that linked subs which are NOT docked to the main sub
|
||||
// (but still close enough to NOT be considered as 'left behind')
|
||||
// are also moved to keep their relative position to the main sub
|
||||
@@ -1095,7 +1098,7 @@ namespace Barotrauma
|
||||
ImmutableHashSet<Character> crewCharacters = GetSessionCrewCharacters(CharacterType.Both);
|
||||
int prevMoney = GetAmountOfMoney(crewCharacters);
|
||||
|
||||
EndMissions();
|
||||
EndMissions(transitionType);
|
||||
|
||||
foreach (Character character in crewCharacters)
|
||||
{
|
||||
@@ -1198,12 +1201,12 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public void EndMissions()
|
||||
public void EndMissions(CampaignMode.TransitionType transitionType)
|
||||
{
|
||||
ImmutableHashSet<Character> crewCharacters = GetSessionCrewCharacters(CharacterType.Both);
|
||||
foreach (Mission mission in missions)
|
||||
{
|
||||
mission.End();
|
||||
mission.End(transitionType);
|
||||
}
|
||||
|
||||
if (missions.Any())
|
||||
|
||||
Reference in New Issue
Block a user