v1.0.20.1 (summer patch)
This commit is contained in:
+19
-10
@@ -223,6 +223,9 @@ namespace Barotrauma
|
||||
case "stats":
|
||||
LoadStats(subElement);
|
||||
break;
|
||||
case "eventmanager":
|
||||
GameMain.GameSession.EventManager.Load(subElement);
|
||||
break;
|
||||
case Wallet.LowerCaseSaveElementName:
|
||||
Bank = new Wallet(Option<Character>.None(), subElement);
|
||||
break;
|
||||
@@ -272,29 +275,35 @@ namespace Barotrauma
|
||||
bool isSubmarineVisible(SubmarineInfo s)
|
||||
=> !GameMain.NetworkMember.ServerSettings.HiddenSubs.Any(h
|
||||
=> s.Name.Equals(h, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
List<SubmarineInfo> availableSubs =
|
||||
SubmarineInfo.SavedSubmarines
|
||||
|
||||
var availableSubs = SubmarineInfo.SavedSubmarines;
|
||||
#if CLIENT
|
||||
if (GameMain.Client != null)
|
||||
{
|
||||
availableSubs = GameMain.Client.ServerSubmarines;
|
||||
}
|
||||
#endif
|
||||
|
||||
List<SubmarineInfo> campaignSubs =
|
||||
availableSubs
|
||||
.Where(s =>
|
||||
s.IsCampaignCompatible
|
||||
&& isSubmarineVisible(s))
|
||||
.ToList();
|
||||
|
||||
if (!availableSubs.Any())
|
||||
if (!campaignSubs.Any())
|
||||
{
|
||||
//None of the available subs were marked as campaign-compatible, just include all visible subs
|
||||
availableSubs.AddRange(
|
||||
SubmarineInfo.SavedSubmarines
|
||||
.Where(isSubmarineVisible));
|
||||
campaignSubs.AddRange(availableSubs.Where(isSubmarineVisible));
|
||||
}
|
||||
|
||||
if (!availableSubs.Any())
|
||||
if (!campaignSubs.Any())
|
||||
{
|
||||
//No subs are visible at all! Just make the selected one available
|
||||
availableSubs.Add(GameMain.NetLobbyScreen.SelectedSub);
|
||||
campaignSubs.Add(GameMain.NetLobbyScreen.SelectedSub);
|
||||
}
|
||||
|
||||
return availableSubs;
|
||||
return campaignSubs;
|
||||
}
|
||||
|
||||
private static void WriteItems(IWriteMessage msg, Dictionary<Identifier, List<PurchasedItem>> purchasedItems)
|
||||
|
||||
Reference in New Issue
Block a user