- fixed exception in GetSubsToLeaveBehind if the round ends when none of the subs is at an exit

- water surface is clamped above the bottom of the hull
- character names don't overlap with health bars
This commit is contained in:
Regalis
2016-10-09 18:20:32 +03:00
parent e7e51fbe0c
commit ef9dce9a0d
3 changed files with 20 additions and 16 deletions
+1 -1
View File
@@ -1328,7 +1328,7 @@ namespace Barotrauma
if (info != null) if (info != null)
{ {
Vector2 namePos = new Vector2(pos.X, pos.Y - 80.0f - (5.0f/cam.Zoom)) - GUI.Font.MeasureString(Info.Name) * 0.5f / cam.Zoom; Vector2 namePos = new Vector2(pos.X, pos.Y - 110.0f - (5.0f/cam.Zoom)) - GUI.Font.MeasureString(Info.Name) * 0.5f / cam.Zoom;
Color nameColor = Color.White; Color nameColor = Color.White;
if (Character.Controlled != null && TeamID!=Character.Controlled.TeamID) if (Character.Controlled != null && TeamID!=Character.Controlled.TeamID)
@@ -241,6 +241,10 @@ namespace Barotrauma
{ {
isRunning = false; isRunning = false;
bool success = CrewManager.characters.Any(c => !c.IsDead);
if (success)
{
if (subsToLeaveBehind == null || leavingSub == null) if (subsToLeaveBehind == null || leavingSub == null)
{ {
DebugConsole.ThrowError("Leaving submarine not selected -> selecting the closest one"); DebugConsole.ThrowError("Leaving submarine not selected -> selecting the closest one");
@@ -249,9 +253,7 @@ namespace Barotrauma
subsToLeaveBehind = GetSubsToLeaveBehind(leavingSub); subsToLeaveBehind = GetSubsToLeaveBehind(leavingSub);
} }
}
bool success = CrewManager.characters.Any(c => !c.IsDead);
GameMain.GameSession.EndShift(""); GameMain.GameSession.EndShift("");
+3 -1
View File
@@ -100,6 +100,8 @@ namespace Barotrauma
Item.UpdateHulls(); Item.UpdateHulls();
Gap.UpdateHulls(); Gap.UpdateHulls();
} }
surface = rect.Y - rect.Height + Volume / rect.Width;
} }
} }
@@ -506,7 +508,7 @@ namespace Barotrauma
} }
//interpolate the position of the rendered surface towards the "target surface" //interpolate the position of the rendered surface towards the "target surface"
surface = MathHelper.Lerp(surface, surfaceY, deltaTime*10.0f); surface = Math.Max(MathHelper.Lerp(surface, surfaceY, deltaTime*10.0f), rect.Y - rect.Height);
if (volume < FullVolume) if (volume < FullVolume)
{ {