From 4dd48d7bf299af9930c78c194fa418fd0d920637 Mon Sep 17 00:00:00 2001 From: Regalis Date: Wed, 20 Jan 2016 00:22:11 +0200 Subject: [PATCH] Fixed shiftsummary showing info for the wrong quest --- Subsurface/Content/InfoTexts.xml | 6 +++--- Subsurface/Content/Missions.xml | 2 +- Subsurface/Content/Orders.xml | 8 ++++---- Subsurface/Source/Events/Quests/MonsterQuest.cs | 2 +- Subsurface/Source/Events/Quests/SalvageQuest.cs | 2 +- Subsurface/Source/GameSession/GameSession.cs | 13 ++++++++++--- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Subsurface/Content/InfoTexts.xml b/Subsurface/Content/InfoTexts.xml index 5b0635aa3..62f842248 100644 --- a/Subsurface/Content/InfoTexts.xml +++ b/Subsurface/Content/InfoTexts.xml @@ -1,8 +1,8 @@  - [sub] has made its way from [location1] to [location2]. - [sub] has arrived at [location2]. - [sub] has returned to [location1]. + [sub] has made its way to [location]. + [sub] has arrived at [location]. + [sub] has returned to [location]. The ocean has claimed [sub] and its crew. Succumbed to their injuries diff --git a/Subsurface/Content/Missions.xml b/Subsurface/Content/Missions.xml index 811751a17..eb09fca5a 100644 --- a/Subsurface/Content/Missions.xml +++ b/Subsurface/Content/Missions.xml @@ -49,7 +49,7 @@ - + - + - + - + diff --git a/Subsurface/Source/Events/Quests/MonsterQuest.cs b/Subsurface/Source/Events/Quests/MonsterQuest.cs index 6b4616414..d315babaa 100644 --- a/Subsurface/Source/Events/Quests/MonsterQuest.cs +++ b/Subsurface/Source/Events/Quests/MonsterQuest.cs @@ -16,7 +16,7 @@ namespace Barotrauma public override Vector2 RadarPosition { - get { return radarPosition; } + get { return monster != null && !monster.IsDead ? radarPosition : Vector2.Zero; } } public MonsterMission(XElement element) diff --git a/Subsurface/Source/Events/Quests/SalvageQuest.cs b/Subsurface/Source/Events/Quests/SalvageQuest.cs index 08878b26c..5bea75a85 100644 --- a/Subsurface/Source/Events/Quests/SalvageQuest.cs +++ b/Subsurface/Source/Events/Quests/SalvageQuest.cs @@ -20,7 +20,7 @@ namespace Barotrauma { get { - return ConvertUnits.ToDisplayUnits(item.SimPosition); + return state>0 ? Vector2.Zero : ConvertUnits.ToDisplayUnits(item.SimPosition); } } diff --git a/Subsurface/Source/GameSession/GameSession.cs b/Subsurface/Source/GameSession/GameSession.cs index 650e4cb4d..a7d0fbb1c 100644 --- a/Subsurface/Source/GameSession/GameSession.cs +++ b/Subsurface/Source/GameSession/GameSession.cs @@ -21,11 +21,13 @@ namespace Barotrauma private ShiftSummary shiftSummary; + private Mission currentMission; + public Mission Mission { get { - if (gameMode != null) return gameMode.Mission; + return currentMission; return null; } } @@ -124,7 +126,11 @@ namespace Barotrauma GameMain.GameScreen.BackgroundCreatureManager.SpawnSprites(80); } - if (Mission!=null) Mission.Start(Level.Loaded); + if (gameMode.Mission!=null) + { + currentMission = gameMode.Mission; + Mission.Start(Level.Loaded); + } shiftSummary = new ShiftSummary(this); @@ -153,8 +159,9 @@ namespace Barotrauma var okButton = new GUIButton(new Rectangle(0, 0, 100, 30), "Ok", Alignment.BottomRight, GUI.Style, summaryFrame.children[0]); okButton.OnClicked = (GUIButton button, object obj) => { GUIMessageBox.MessageBoxes.Dequeue(); return true; }; - TaskManager.EndShift(); + + currentMission = null; //gameMode.End(); //return true;