Handling exceptions in particle update, gamesession UI order fix, traitor setting loading fix

This commit is contained in:
Regalis
2016-11-16 20:14:14 +02:00
parent d37bad2d44
commit 16cf9f6c81
5 changed files with 18 additions and 5 deletions
+1 -1
View File
@@ -364,7 +364,7 @@ namespace Barotrauma
{ {
if (gameMode != null) gameMode.AddToGUIUpdateList(); if (gameMode != null) gameMode.AddToGUIUpdateList();
if (infoFrame != null) infoButton.AddToGUIUpdateList(); if (infoFrame != null) infoFrame.AddToGUIUpdateList();
} }
public void Update(float deltaTime) public void Update(float deltaTime)
@@ -264,6 +264,7 @@ namespace Barotrauma.Networking
var traitorsEnabled = TraitorsEnabled; var traitorsEnabled = TraitorsEnabled;
Enum.TryParse<YesNoMaybe>(ToolBox.GetAttributeString(doc.Root, "TraitorsEnabled", "No"), out traitorsEnabled); Enum.TryParse<YesNoMaybe>(ToolBox.GetAttributeString(doc.Root, "TraitorsEnabled", "No"), out traitorsEnabled);
TraitorsEnabled = traitorsEnabled;
GameMain.NetLobbyScreen.SetTraitorsEnabled(traitorsEnabled); GameMain.NetLobbyScreen.SetTraitorsEnabled(traitorsEnabled);
FileStreamSender.MaxTransferDuration = new TimeSpan(0,0,ToolBox.GetAttributeInt(doc.Root, "MaxFileTransferDuration", 150)); FileStreamSender.MaxTransferDuration = new TimeSpan(0,0,ToolBox.GetAttributeInt(doc.Root, "MaxFileTransferDuration", 150));
+12 -1
View File
@@ -109,7 +109,18 @@ namespace Barotrauma.Particles
{ {
for (int i = 0; i < particleCount; i++) for (int i = 0; i < particleCount; i++)
{ {
if (!particles[i].Update(deltaTime)) RemoveParticle(i); bool remove = false;
try
{
remove = !particles[i].Update(deltaTime);
}
catch (Exception e)
{
DebugConsole.ThrowError("Particle update failed", e);
remove = true;
}
if (remove) RemoveParticle(i);
} }
} }
+1 -1
View File
@@ -657,7 +657,7 @@ namespace Barotrauma
private GUIFrame CreateWiringPanel() private GUIFrame CreateWiringPanel()
{ {
GUIFrame frame = new GUIFrame(new Rectangle(0,0,50,300), null, Alignment.Right | Alignment.CenterY, GUI.Style); GUIFrame frame = new GUIFrame(new Rectangle(0,0,65,300), null, Alignment.Right | Alignment.CenterY, GUI.Style);
frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f); frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
GUIListBox listBox = new GUIListBox(Rectangle.Empty, GUI.Style, frame); GUIListBox listBox = new GUIListBox(Rectangle.Empty, GUI.Style, frame);
+3 -2
View File
@@ -91,8 +91,6 @@ namespace Barotrauma
public override void AddToGUIUpdateList() public override void AddToGUIUpdateList()
{ {
if (GameMain.GameSession != null) GameMain.GameSession.AddToGUIUpdateList();
if (Character.Controlled != null && Character.Controlled.SelectedConstruction != null) if (Character.Controlled != null && Character.Controlled.SelectedConstruction != null)
{ {
if (Character.Controlled.SelectedConstruction == Character.Controlled.ClosestItem) if (Character.Controlled.SelectedConstruction == Character.Controlled.ClosestItem)
@@ -100,6 +98,9 @@ namespace Barotrauma
Character.Controlled.SelectedConstruction.AddToGUIUpdateList(); Character.Controlled.SelectedConstruction.AddToGUIUpdateList();
} }
} }
if (GameMain.GameSession != null) GameMain.GameSession.AddToGUIUpdateList();
Character.AddAllToGUIUpdateList(); Character.AddAllToGUIUpdateList();
} }