Fixed number of completed missions in a level not increasing if the connection is not selected after completing a mission. Closes #594

This commit is contained in:
Joonas Rikkonen
2018-08-07 13:21:46 +03:00
parent 4b0c54d664
commit 004250409a

View File

@@ -446,6 +446,7 @@ namespace Barotrauma
for (int i = 0; i < connections.Count; i++)
{
if (!connections[i].Passed) continue;
connections[i].CheckMissionCompleted();
var connectionElement = new XElement("connection", new XAttribute("i", i));
if (connections[i].MissionsCompleted > 0) connectionElement.Add(new XAttribute("m", connections[i].MissionsCompleted));
@@ -525,6 +526,15 @@ namespace Barotrauma
MissionsCompleted = 0;
}
public void CheckMissionCompleted()
{
if (mission != null && mission.Completed)
{
MissionsCompleted++;
mission = null;
}
}
public Location OtherLocation(Location location)
{
if (locations[0] == location)