v0.10.5.1

This commit is contained in:
Juan Pablo Arce
2020-09-22 11:31:56 -03:00
parent 44032d0ae0
commit 0002ad2c50
343 changed files with 12276 additions and 5023 deletions
@@ -109,7 +109,7 @@ namespace Barotrauma
{
get
{
if (Level.Loaded != null && !Level.Loaded.Generating &&
if (Level.Loaded?.EndLocation != null && !Level.Loaded.Generating &&
Level.Loaded.Type == LevelData.LevelType.LocationConnection &&
GetAvailableTransition(out _, out _) == TransitionType.ProgressToNextEmptyLocation)
{
@@ -270,7 +270,9 @@ namespace Barotrauma
{
if (leavingSub.AtEndPosition)
{
if (Map.EndLocation != null && map.SelectedLocation == Map.EndLocation)
if (Map.EndLocation != null &&
map.SelectedLocation == Map.EndLocation &&
Map.EndLocation.Connections.Any(c => c.LevelData == Level.Loaded.LevelData))
{
nextLevel = map.StartLocation.LevelData;
return TransitionType.End;
@@ -463,8 +465,12 @@ namespace Barotrauma
}
}
foreach (CharacterInfo ci in CrewManager.CharacterInfos)
foreach (CharacterInfo ci in CrewManager.CharacterInfos.ToList())
{
if (ci.CauseOfDeath != null)
{
CrewManager.RemoveCharacterInfo(ci);
}
ci?.ResetCurrentOrder();
}
@@ -677,7 +683,7 @@ namespace Barotrauma
public void OutpostNPCAttacked(Character npc, Character attacker, AttackResult attackResult)
{
if (npc == null || attacker == null || npc.IsDead || npc.TurnedHostileByEvent) { return; }
if (npc == null || attacker == null || npc.IsDead || npc.IsInstigator) { return; }
if (npc.TeamID != Character.TeamType.FriendlyNPC) { return; }
if (!attacker.IsRemotePlayer && attacker != Character.Controlled) { return; }
Location location = Map?.CurrentLocation;
@@ -36,6 +36,8 @@ namespace Barotrauma
get { return false; }
}
public virtual void UpdateWhilePaused(float deltaTime) { }
public GameModePreset Preset
{
get { return preset; }
@@ -178,11 +178,18 @@ namespace Barotrauma
characterData.Clear();
string characterDataPath = GetCharacterDataSavePath();
var characterDataDoc = XMLExtensions.TryLoadXml(characterDataPath);
if (characterDataDoc?.Root == null) return;
foreach (XElement subElement in characterDataDoc.Root.Elements())
if (!File.Exists(characterDataPath))
{
characterData.Add(new CharacterCampaignData(subElement));
DebugConsole.ThrowError($"Failed to load the character data for the campaign. Could not find the file \"{characterDataPath}\".");
}
else
{
var characterDataDoc = XMLExtensions.TryLoadXml(characterDataPath);
if (characterDataDoc?.Root == null) { return; }
foreach (XElement subElement in characterDataDoc.Root.Elements())
{
characterData.Add(new CharacterCampaignData(subElement));
}
}
#endif
}