From de87f84ba4915654b707fc95e87a44c094f03c2e Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Tue, 23 Apr 2019 15:37:09 +0300 Subject: [PATCH] (e704a7904) Fixed "lone sailor" achievement not unlocking because the watchmen were counted as members of the crew --- .../Source/SteamAchievementManager.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/SteamAchievementManager.cs b/Barotrauma/BarotraumaShared/Source/SteamAchievementManager.cs index d707be008..9dfe58a9e 100644 --- a/Barotrauma/BarotraumaShared/Source/SteamAchievementManager.cs +++ b/Barotrauma/BarotraumaShared/Source/SteamAchievementManager.cs @@ -336,9 +336,12 @@ namespace Barotrauma UnlockAchievement("survivereactormeltdown"); } #endif - - var charactersInSub = Character.CharacterList.FindAll(c => !c.IsDead && + var charactersInSub = Character.CharacterList.FindAll(c => + !c.IsDead && + c.TeamID != Character.TeamType.FriendlyNPC && + !(c.AIController is EnemyAIController) && (c.Submarine == gameSession.Submarine || (Level.Loaded?.EndOutpost != null && c.Submarine == Level.Loaded.EndOutpost))); + if (charactersInSub.Count == 1) { //there must be some non-enemy casualties to get the last mant standing achievement @@ -346,7 +349,11 @@ namespace Barotrauma { UnlockAchievement(charactersInSub[0], "lastmanstanding"); } - else if (!Character.CharacterList.Any(c => !(c.AIController is EnemyAIController))) + //lone sailor achievement if alone in the sub and there are no other characters with the same team ID + else if (!Character.CharacterList.Any(c => + c != charactersInSub[0] && + c.TeamID == charactersInSub[0].TeamID && + !(c.AIController is EnemyAIController))) { UnlockAchievement(charactersInSub[0], "lonesailor"); }