- option to select which location autopilot navigates towards
- generating "dummy locations" for the MP gamesessions (visible in sonar and mission descriptions) - EndGame network message tells the clients if the mission was successful (because the message may arrive before the sub has reached the exit or before some character has died at the client's end)
This commit is contained in:
@@ -57,11 +57,11 @@ namespace Barotrauma
|
|||||||
ToolBox.GetAttributeString(element, "description2", "")
|
ToolBox.GetAttributeString(element, "description2", "")
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < descriptions.Length; i++ )
|
for (int i = 0; i < descriptions.Length; i++)
|
||||||
{
|
{
|
||||||
for (int n = 0; n < 2;n++ )
|
for (int n = 0; n < 2; n++)
|
||||||
{
|
{
|
||||||
descriptions[i] = descriptions[i].Replace("[location" + (n + 1) + "]", Locations[n]);
|
descriptions[i] = descriptions[i].Replace("[location" + (n + 1) + "]", locations[n].Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,9 +137,6 @@ namespace Barotrauma
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Items.Components.Radar.StartMarker = Locations[0];
|
|
||||||
Items.Components.Radar.EndMarker = Locations[1];
|
|
||||||
|
|
||||||
subs = new Submarine[] { Submarine.MainSubs[0], Submarine.MainSubs[1] };
|
subs = new Submarine[] { Submarine.MainSubs[0], Submarine.MainSubs[1] };
|
||||||
subs[1].SetPosition(Level.Loaded.EndPosition - new Vector2(0.0f, 2000.0f));
|
subs[1].SetPosition(Level.Loaded.EndPosition - new Vector2(0.0f, 2000.0f));
|
||||||
subs[1].FlipX();
|
subs[1].FlipX();
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private int reward;
|
private int reward;
|
||||||
|
|
||||||
protected string[] Locations = new string[2];
|
|
||||||
|
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get { return name; }
|
get { return name; }
|
||||||
@@ -47,6 +45,7 @@ namespace Barotrauma
|
|||||||
public bool Completed
|
public bool Completed
|
||||||
{
|
{
|
||||||
get { return completed; }
|
get { return completed; }
|
||||||
|
set { completed = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual string RadarLabel
|
public virtual string RadarLabel
|
||||||
@@ -112,10 +111,8 @@ namespace Barotrauma
|
|||||||
messages.Add(ToolBox.GetAttributeString(subElement, "text", ""));
|
messages.Add(ToolBox.GetAttributeString(subElement, "text", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (int n = 0; n < 2; n++)
|
for (int n = 0; n < 2; n++)
|
||||||
{
|
{
|
||||||
Locations[n] = locations[n].Name;
|
|
||||||
description = description.Replace("[location" + (n + 1) + "]", locations[n].Name);
|
description = description.Replace("[location" + (n + 1) + "]", locations[n].Name);
|
||||||
|
|
||||||
successMessage = successMessage.Replace("[location" + (n + 1) + "]", locations[n].Name);
|
successMessage = successMessage.Replace("[location" + (n + 1) + "]", locations[n].Name);
|
||||||
@@ -227,7 +224,12 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public virtual void Update(float deltaTime) { }
|
public virtual void Update(float deltaTime) { }
|
||||||
|
|
||||||
public virtual bool AssignTeamIDs(List<Networking.Client> clients,out int hostTeam) { clients.ForEach(client => { client.TeamID = 1; }); hostTeam = 1; return false; }
|
public virtual bool AssignTeamIDs(List<Networking.Client> clients, out int hostTeam)
|
||||||
|
{
|
||||||
|
clients.ForEach(c => c.TeamID = 1);
|
||||||
|
hostTeam = 1;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void ShowMessage(int index)
|
public void ShowMessage(int index)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,15 +17,9 @@ namespace Barotrauma
|
|||||||
public MissionMode(GameModePreset preset, object param)
|
public MissionMode(GameModePreset preset, object param)
|
||||||
: base(preset, param)
|
: base(preset, param)
|
||||||
{
|
{
|
||||||
Location[] locations = new Location[2];
|
Location[] locations = { GameMain.GameSession.StartLocation, GameMain.GameSession.EndLocation };
|
||||||
|
|
||||||
MTRandom rand = new MTRandom(ToolBox.StringToInt(GameMain.NetLobbyScreen.LevelSeed));
|
MTRandom rand = new MTRandom(ToolBox.StringToInt(GameMain.NetLobbyScreen.LevelSeed));
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++)
|
|
||||||
{
|
|
||||||
locations[i] = Location.CreateRandom(new Vector2((float)rand.NextDouble() * 10000.0f, (float)rand.NextDouble() * 10000.0f));
|
|
||||||
}
|
|
||||||
|
|
||||||
mission = Mission.LoadRandom(locations, rand, param as string);
|
mission = Mission.LoadRandom(locations, rand, param as string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public readonly GameMode gameMode;
|
public readonly GameMode gameMode;
|
||||||
|
|
||||||
|
//two locations used as the start and end in the MP mode
|
||||||
|
private Location[] dummyLocations;
|
||||||
|
|
||||||
private InfoFrameTab selectedTab;
|
private InfoFrameTab selectedTab;
|
||||||
private GUIButton infoButton;
|
private GUIButton infoButton;
|
||||||
private GUIFrame infoFrame;
|
private GUIFrame infoFrame;
|
||||||
@@ -51,6 +54,36 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location StartLocation
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (Map != null) return Map.CurrentLocation;
|
||||||
|
|
||||||
|
if (dummyLocations==null)
|
||||||
|
{
|
||||||
|
CreateDummyLocations();
|
||||||
|
}
|
||||||
|
|
||||||
|
return dummyLocations[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location EndLocation
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (Map != null) return Map.SelectedLocation;
|
||||||
|
|
||||||
|
if (dummyLocations == null)
|
||||||
|
{
|
||||||
|
CreateDummyLocations();
|
||||||
|
}
|
||||||
|
|
||||||
|
return dummyLocations[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Submarine Submarine
|
public Submarine Submarine
|
||||||
{
|
{
|
||||||
get { return submarine; }
|
get { return submarine; }
|
||||||
@@ -79,12 +112,10 @@ namespace Barotrauma
|
|||||||
|
|
||||||
this.saveFile = saveFile;
|
this.saveFile = saveFile;
|
||||||
|
|
||||||
//guiRoot = new GUIFrame(new Rectangle(0,0,GameMain.GraphicsWidth,GameMain.GraphicsWidth), Color.Transparent);
|
|
||||||
|
|
||||||
infoButton = new GUIButton(new Rectangle(10, 10, 100, 20), "Info", GUI.Style, null);
|
infoButton = new GUIButton(new Rectangle(10, 10, 100, 20), "Info", GUI.Style, null);
|
||||||
infoButton.OnClicked = ToggleInfoFrame;
|
infoButton.OnClicked = ToggleInfoFrame;
|
||||||
|
|
||||||
if (gameModePreset!=null) gameMode = gameModePreset.Instantiate(missionType);
|
if (gameModePreset != null) gameMode = gameModePreset.Instantiate(missionType);
|
||||||
this.submarine = submarine;
|
this.submarine = submarine;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +138,17 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CreateDummyLocations()
|
||||||
|
{
|
||||||
|
dummyLocations = new Location[2];
|
||||||
|
|
||||||
|
MTRandom rand = new MTRandom(ToolBox.StringToInt(GameMain.NetLobbyScreen.LevelSeed));
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
dummyLocations[i] = Location.CreateRandom(new Vector2((float)rand.NextDouble() * 10000.0f, (float)rand.NextDouble() * 10000.0f));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void StartShift(string levelSeed, bool loadSecondSub = true)
|
public void StartShift(string levelSeed, bool loadSecondSub = true)
|
||||||
{
|
{
|
||||||
Level level = Level.CreateRandom(levelSeed);
|
Level level = Level.CreateRandom(levelSeed);
|
||||||
@@ -164,8 +206,6 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (gameMode!=null) gameMode.Start();
|
if (gameMode!=null) gameMode.Start();
|
||||||
|
|
||||||
Items.Components.Radar.StartMarker = "Start";
|
|
||||||
Items.Components.Radar.EndMarker = "End";
|
|
||||||
if (gameMode.Mission != null) Mission.Start(Level.Loaded);
|
if (gameMode.Mission != null) Mission.Start(Level.Loaded);
|
||||||
|
|
||||||
TaskManager.StartShift(level);
|
TaskManager.StartShift(level);
|
||||||
|
|||||||
@@ -58,10 +58,9 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Submarine.MainSub != null) text = text.Replace("[sub]", Submarine.MainSub.Name);
|
if (Submarine.MainSub != null) text = text.Replace("[sub]", Submarine.MainSub.Name);
|
||||||
if (GameMain.GameSession != null && GameMain.GameSession.Map != null)
|
if (GameMain.GameSession != null && GameMain.GameSession.StartLocation != null)
|
||||||
{
|
{
|
||||||
if (GameMain.GameSession.Map.CurrentLocation!=null)
|
text = text.Replace("[location]", GameMain.GameSession.StartLocation.Name);
|
||||||
text = text.Replace("[location]", GameMain.GameSession.Map.CurrentLocation.Name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
this.gameSession = gameSession;
|
this.gameSession = gameSession;
|
||||||
|
|
||||||
startLocation = gameSession.Map==null ? null : gameSession.Map.CurrentLocation;
|
startLocation = gameSession.StartLocation;
|
||||||
endLocation = gameSession.Map==null ? null : gameSession.Map.SelectedLocation;
|
endLocation = gameSession.EndLocation;
|
||||||
|
|
||||||
selectedMission = gameSession.Mission;
|
selectedMission = gameSession.Mission;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,6 @@ namespace Barotrauma.Items.Components
|
|||||||
private List<RadarBlip> radarBlips;
|
private List<RadarBlip> radarBlips;
|
||||||
private float prevPingRadius;
|
private float prevPingRadius;
|
||||||
|
|
||||||
public static string StartMarker = "Start";
|
|
||||||
public static string EndMarker = "End";
|
|
||||||
|
|
||||||
[HasDefaultValue(10000.0f, false)]
|
[HasDefaultValue(10000.0f, false)]
|
||||||
public float Range
|
public float Range
|
||||||
{
|
{
|
||||||
@@ -266,11 +263,11 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
|
|
||||||
DrawMarker(spriteBatch,
|
DrawMarker(spriteBatch,
|
||||||
(GameMain.GameSession.Map == null) ? StartMarker : GameMain.GameSession.Map.CurrentLocation.Name,
|
GameMain.GameSession.StartLocation.Name,
|
||||||
(Level.Loaded.StartPosition - item.WorldPosition), displayScale, center, (rect.Width * 0.5f));
|
(Level.Loaded.StartPosition - item.WorldPosition), displayScale, center, (rect.Width * 0.5f));
|
||||||
|
|
||||||
DrawMarker(spriteBatch,
|
DrawMarker(spriteBatch,
|
||||||
(GameMain.GameSession.Map == null) ? EndMarker : GameMain.GameSession.Map.SelectedLocation.Name,
|
GameMain.GameSession.EndLocation.Name,
|
||||||
(Level.Loaded.EndPosition - item.WorldPosition), displayScale, center, (rect.Width * 0.5f));
|
(Level.Loaded.EndPosition - item.WorldPosition), displayScale, center, (rect.Width * 0.5f));
|
||||||
|
|
||||||
if (GameMain.GameSession.Mission != null)
|
if (GameMain.GameSession.Mission != null)
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ namespace Barotrauma.Items.Components
|
|||||||
private Vector2 targetVelocity;
|
private Vector2 targetVelocity;
|
||||||
|
|
||||||
private GUITickBox autopilotTickBox, maintainPosTickBox;
|
private GUITickBox autopilotTickBox, maintainPosTickBox;
|
||||||
|
private GUITickBox levelEndTickBox, levelStartTickBox;
|
||||||
|
|
||||||
private bool autoPilot;
|
private bool autoPilot;
|
||||||
|
|
||||||
@@ -47,21 +48,23 @@ namespace Barotrauma.Items.Components
|
|||||||
if (value == autoPilot) return;
|
if (value == autoPilot) return;
|
||||||
|
|
||||||
autoPilot = value;
|
autoPilot = value;
|
||||||
|
|
||||||
autopilotTickBox.Selected = value;
|
autopilotTickBox.Selected = value;
|
||||||
|
|
||||||
maintainPosTickBox.Enabled = autoPilot;
|
maintainPosTickBox.Enabled = autoPilot;
|
||||||
|
levelEndTickBox.Enabled = autoPilot;
|
||||||
|
levelStartTickBox.Enabled = autoPilot;
|
||||||
|
|
||||||
if (autoPilot)
|
if (autoPilot)
|
||||||
{
|
{
|
||||||
if (pathFinder==null) pathFinder = new PathFinder(WayPoint.WayPointList, false);
|
if (pathFinder == null) pathFinder = new PathFinder(WayPoint.WayPointList, false);
|
||||||
steeringPath = pathFinder.FindPath(
|
ToggleMaintainPosition(maintainPosTickBox);
|
||||||
ConvertUnits.ToSimUnits(item.WorldPosition),
|
|
||||||
TargetPosition == null ? ConvertUnits.ToSimUnits(Level.Loaded.EndPosition) : (Vector2)TargetPosition);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
maintainPosTickBox.Selected = false;
|
maintainPosTickBox.Selected = false;
|
||||||
|
levelEndTickBox.Selected = false;
|
||||||
|
levelStartTickBox.Selected = false;
|
||||||
|
|
||||||
posToMaintain = null;
|
posToMaintain = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -114,9 +117,24 @@ namespace Barotrauma.Items.Components
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
maintainPosTickBox = new GUITickBox(new Rectangle(0, 50, 20, 20), "Maintain position", Alignment.TopLeft, GuiFrame);
|
maintainPosTickBox = new GUITickBox(new Rectangle(5, 50, 15, 15), "Maintain position", Alignment.TopLeft, GUI.SmallFont, GuiFrame);
|
||||||
maintainPosTickBox.Enabled = false;
|
maintainPosTickBox.Enabled = false;
|
||||||
maintainPosTickBox.OnSelected = ToggleMaintainPosition;
|
maintainPosTickBox.OnSelected = ToggleMaintainPosition;
|
||||||
|
|
||||||
|
levelStartTickBox = new GUITickBox(
|
||||||
|
new Rectangle(5, 70, 15, 15),
|
||||||
|
GameMain.GameSession.StartLocation.Name,
|
||||||
|
Alignment.TopLeft, GUI.SmallFont, GuiFrame);
|
||||||
|
levelStartTickBox.Enabled = false;
|
||||||
|
levelStartTickBox.OnSelected = SelectDestination;
|
||||||
|
|
||||||
|
levelEndTickBox = new GUITickBox(
|
||||||
|
new Rectangle(5, 90, 15, 15),
|
||||||
|
GameMain.GameSession.EndLocation.Name,
|
||||||
|
Alignment.TopLeft, GUI.SmallFont, GuiFrame);
|
||||||
|
levelEndTickBox.Enabled = false;
|
||||||
|
levelEndTickBox.OnSelected = SelectDestination;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update(float deltaTime, Camera cam)
|
public override void Update(float deltaTime, Camera cam)
|
||||||
@@ -332,6 +350,28 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdatePath()
|
||||||
|
{
|
||||||
|
Vector2 target;
|
||||||
|
if (TargetPosition != null)
|
||||||
|
{
|
||||||
|
target = (Vector2)TargetPosition;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (levelEndTickBox.Selected)
|
||||||
|
{
|
||||||
|
target = ConvertUnits.ToSimUnits(Level.Loaded.EndPosition);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
target = ConvertUnits.ToSimUnits(Level.Loaded.StartPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
steeringPath = pathFinder.FindPath(ConvertUnits.ToSimUnits(item.WorldPosition), target);
|
||||||
|
}
|
||||||
|
|
||||||
private void SteerTowardsPosition(Vector2 worldPosition)
|
private void SteerTowardsPosition(Vector2 worldPosition)
|
||||||
{
|
{
|
||||||
float prediction = 10.0f;
|
float prediction = 10.0f;
|
||||||
@@ -346,7 +386,7 @@ namespace Barotrauma.Items.Components
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TargetVelocity = targetSpeed/5.0f;
|
TargetVelocity = targetSpeed / 5.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,21 +394,42 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
valueChanged = true;
|
valueChanged = true;
|
||||||
|
|
||||||
if (tickBox.Selected)
|
levelStartTickBox.Selected = false;
|
||||||
{
|
levelEndTickBox.Selected = false;
|
||||||
if (item.Submarine == null)
|
|
||||||
{
|
if (item.Submarine == null)
|
||||||
posToMaintain = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
posToMaintain = item.Submarine.WorldPosition;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
posToMaintain = null;
|
posToMaintain = null;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
posToMaintain = item.Submarine.WorldPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
tickBox.Selected = true;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool SelectDestination(GUITickBox tickBox)
|
||||||
|
{
|
||||||
|
valueChanged = true;
|
||||||
|
|
||||||
|
if (tickBox == levelStartTickBox)
|
||||||
|
{
|
||||||
|
levelEndTickBox.Selected = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
levelStartTickBox.Selected = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
maintainPosTickBox.Selected = false;
|
||||||
|
posToMaintain = null;
|
||||||
|
|
||||||
|
UpdatePath();
|
||||||
|
|
||||||
|
tickBox.Selected = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -399,6 +460,10 @@ namespace Barotrauma.Items.Components
|
|||||||
message.Write(((Vector2)posToMaintain).X);
|
message.Write(((Vector2)posToMaintain).X);
|
||||||
message.Write(((Vector2)posToMaintain).Y);
|
message.Write(((Vector2)posToMaintain).Y);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message.Write(levelStartTickBox.Selected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -411,6 +476,8 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
Vector2? newPosToMaintain = null;
|
Vector2? newPosToMaintain = null;
|
||||||
|
|
||||||
|
bool headingToStart = false;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
newTargetVelocity = new Vector2(message.ReadFloat(), message.ReadFloat());
|
newTargetVelocity = new Vector2(message.ReadFloat(), message.ReadFloat());
|
||||||
@@ -424,6 +491,10 @@ namespace Barotrauma.Items.Components
|
|||||||
message.ReadFloat(),
|
message.ReadFloat(),
|
||||||
message.ReadFloat());
|
message.ReadFloat());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
headingToStart = message.ReadBoolean();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,6 +508,20 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
maintainPosTickBox.Selected = newPosToMaintain != null;
|
maintainPosTickBox.Selected = newPosToMaintain != null;
|
||||||
posToMaintain = newPosToMaintain;
|
posToMaintain = newPosToMaintain;
|
||||||
|
|
||||||
|
if (posToMaintain == null && autoPilot)
|
||||||
|
{
|
||||||
|
levelStartTickBox.Selected = headingToStart;
|
||||||
|
levelEndTickBox.Selected = !headingToStart;
|
||||||
|
|
||||||
|
UpdatePath();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
levelStartTickBox.Selected = false;
|
||||||
|
levelEndTickBox.Selected = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -566,6 +566,13 @@ namespace Barotrauma.Networking
|
|||||||
break;
|
break;
|
||||||
case (byte)PacketTypes.EndGame:
|
case (byte)PacketTypes.EndGame:
|
||||||
string endMessage = inc.ReadString();
|
string endMessage = inc.ReadString();
|
||||||
|
bool missionSuccessful = inc.ReadBoolean();
|
||||||
|
|
||||||
|
if (missionSuccessful && GameMain.GameSession.Mission != null)
|
||||||
|
{
|
||||||
|
GameMain.GameSession.Mission.Completed = true;
|
||||||
|
}
|
||||||
|
|
||||||
CoroutineManager.StartCoroutine(EndGame(endMessage));
|
CoroutineManager.StartCoroutine(EndGame(endMessage));
|
||||||
break;
|
break;
|
||||||
case (byte)PacketTypes.Respawn:
|
case (byte)PacketTypes.Respawn:
|
||||||
|
|||||||
@@ -1082,6 +1082,7 @@ namespace Barotrauma.Networking
|
|||||||
endMessage += TraitorManager.GetEndMessage();
|
endMessage += TraitorManager.GetEndMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Mission mission = GameMain.GameSession.Mission;
|
||||||
GameMain.GameSession.gameMode.End(endMessage);
|
GameMain.GameSession.gameMode.End(endMessage);
|
||||||
|
|
||||||
if (autoRestart) AutoRestartTimer = AutoRestartInterval;
|
if (autoRestart) AutoRestartTimer = AutoRestartInterval;
|
||||||
@@ -1108,6 +1109,7 @@ namespace Barotrauma.Networking
|
|||||||
NetOutgoingMessage msg = server.CreateMessage();
|
NetOutgoingMessage msg = server.CreateMessage();
|
||||||
msg.Write((byte)PacketTypes.EndGame);
|
msg.Write((byte)PacketTypes.EndGame);
|
||||||
msg.Write(endMessage);
|
msg.Write(endMessage);
|
||||||
|
msg.Write(mission != null && mission.Completed);
|
||||||
|
|
||||||
if (server.ConnectionsCount > 0)
|
if (server.ConnectionsCount > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user