diff --git a/Subsurface/Properties/AssemblyInfo.cs b/Subsurface/Properties/AssemblyInfo.cs index 68f54c4be..48d2df213 100644 --- a/Subsurface/Properties/AssemblyInfo.cs +++ b/Subsurface/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.3.4.1")] -[assembly: AssemblyFileVersion("0.3.4.1")] +[assembly: AssemblyVersion("0.3.4.2")] +[assembly: AssemblyFileVersion("0.3.4.2")] diff --git a/Subsurface/Source/Characters/AI/EnemyAIController.cs b/Subsurface/Source/Characters/AI/EnemyAIController.cs index 7dccdc1a4..9de16e3aa 100644 --- a/Subsurface/Source/Characters/AI/EnemyAIController.cs +++ b/Subsurface/Source/Characters/AI/EnemyAIController.cs @@ -284,7 +284,7 @@ namespace Barotrauma float sectionDamage = wall.SectionDamage(sectionIndex); for (int i = sectionIndex - 2; i <= sectionIndex + 2; i++) { - if (wall.SectionHasHole(i)) + if (wall.SectionBodyDisabled(i)) { sectionIndex = i; break; diff --git a/Subsurface/Source/Map/Hull.cs b/Subsurface/Source/Map/Hull.cs index d8cd83b2a..e79f407f1 100644 --- a/Subsurface/Source/Map/Hull.cs +++ b/Subsurface/Source/Map/Hull.cs @@ -472,8 +472,10 @@ namespace Barotrauma foreach (var gap in ConnectedGaps.Where(gap => gap.Open > 0)) { var pos = gap.Position - body.Position; + var distance = MathHelper.Max(Vector2.DistanceSquared(body.Position, gap.Position)/1000,1f); + pos.Normalize(); - body.body.ApplyForce((pos * gap.LerpedFlowForce) * deltaTime); + body.body.ApplyForce((pos * (gap.LerpedFlowForce/distance)) * deltaTime); } } diff --git a/Subsurface/Source/Map/Structure.cs b/Subsurface/Source/Map/Structure.cs index 3064762ac..ecf39cc5a 100644 --- a/Subsurface/Source/Map/Structure.cs +++ b/Subsurface/Source/Map/Structure.cs @@ -259,13 +259,13 @@ namespace Barotrauma if (prefab.CastShadow) { - GeneateConvexHull(); + GenerateConvexHull(); } InsertToList(); } - private void GeneateConvexHull() + private void GenerateConvexHull() { // If not null and not empty , remove the hulls from the system if(_convexHulls != null && _convexHulls.Any()) @@ -452,13 +452,16 @@ namespace Barotrauma sections[sectionIndex].isHighLighted = true; } - public bool SectionHasHole(int sectionIndex) + public bool SectionBodyDisabled(int sectionIndex) { if (sectionIndex < 0 || sectionIndex >= sections.Length) return false; return (sections[sectionIndex].damage>=prefab.MaxHealth); } + /// + /// Sections that are leaking have a gap placed on them + /// public bool SectionIsLeaking(int sectionIndex) { if (sectionIndex < 0 || sectionIndex >= sections.Length) return false; @@ -528,7 +531,7 @@ namespace Barotrauma float damageAmount = attack.GetStructureDamage(deltaTime); - if (playSound && !SectionHasHole(i)) + if (playSound && !SectionBodyDisabled(i)) { DamageSoundType damageSoundType = (attack.DamageType == DamageType.Blunt) ? DamageSoundType.StructureBlunt : DamageSoundType.StructureSlash; SoundPlayer.PlayDamageSound(damageSoundType, damageAmount, position); @@ -561,7 +564,7 @@ namespace Barotrauma sections[sectionIndex].gap.Remove(); sections[sectionIndex].gap = null; if(CastShadow) - GeneateConvexHull(); + GenerateConvexHull(); } } else @@ -575,20 +578,20 @@ namespace Barotrauma gapRect.Height += 20; sections[sectionIndex].gap = new Gap(gapRect, !isHorizontal, Submarine); if(CastShadow) - GeneateConvexHull(); + GenerateConvexHull(); } } if (sections[sectionIndex].gap != null) sections[sectionIndex].gap.Open = (float)Math.Pow(((damage / prefab.MaxHealth)-0.5)*2.0, 2.0); - bool hadHole = SectionHasHole(sectionIndex); + bool hadHole = SectionBodyDisabled(sectionIndex); sections[sectionIndex].damage = MathHelper.Clamp(damage, 0.0f, prefab.MaxHealth); - bool hasHole = SectionHasHole(sectionIndex); + bool hasHole = SectionBodyDisabled(sectionIndex); if (hadHole == hasHole) return; - if (hasHole) Explosion.ApplyExplosionForces(sections[sectionIndex].gap.WorldPosition, 500.0f, 5.0f, 0.0f, 0.0f); + //if (hasHole) Explosion.ApplyExplosionForces(sections[sectionIndex].gap.WorldPosition, 500.0f, 5.0f, 0.0f, 0.0f); UpdateSections(); } @@ -600,11 +603,18 @@ namespace Barotrauma } bodies.Clear(); var mergedSections = new List(); - foreach (var section in sections) + for (int i = 0; i < sections.Count(); i++ ) { - if(section.gap == null) + var section = sections[i]; + + if (!SectionBodyDisabled(i)) + { mergedSections.Add(section); - if (section.gap == null || mergedSections.Count <= 0) continue; + continue; + } + + if (mergedSections.Count <= 0) continue; + Rectangle mergedRect; if (isHorizontal) mergedRect = new Rectangle(mergedSections.Min(x => x.rect.Left), mergedSections.Max(x => x.rect.Top), diff --git a/Subsurface/Source/Map/Submarine.cs b/Subsurface/Source/Map/Submarine.cs index 1fd6db4ca..c1a88ce94 100644 --- a/Subsurface/Source/Map/Submarine.cs +++ b/Subsurface/Source/Map/Submarine.cs @@ -374,7 +374,7 @@ namespace Barotrauma { if (structure.IsPlatform || structure.StairDirection != Direction.None) return -1; int sectionIndex = structure.FindSectionIndex(ConvertUnits.ToDisplayUnits(point)); - if (sectionIndex > -1 && structure.SectionHasHole(sectionIndex)) return -1; + if (sectionIndex > -1 && structure.SectionBodyDisabled(sectionIndex)) return -1; } if (fraction < closestFraction) diff --git a/Subsurface/Source/Networking/GameClient.cs b/Subsurface/Source/Networking/GameClient.cs index 21c5ed03d..f03b2f480 100644 --- a/Subsurface/Source/Networking/GameClient.cs +++ b/Subsurface/Source/Networking/GameClient.cs @@ -291,7 +291,7 @@ namespace Barotrauma.Networking if (denyMessage == "Password required!" || denyMessage == "Wrong password!") { - GameMain.ServerListScreen.JoinServer(serverIP, true); + GameMain.ServerListScreen.JoinServer(serverIP, true, denyMessage); } else { diff --git a/Subsurface/Source/Networking/GameServer.cs b/Subsurface/Source/Networking/GameServer.cs index 3d94bc17f..32de5c2bf 100644 --- a/Subsurface/Source/Networking/GameServer.cs +++ b/Subsurface/Source/Networking/GameServer.cs @@ -631,7 +631,7 @@ namespace Barotrauma.Networking return; } -#if DEBUG +#if !DEBUG if (!string.IsNullOrWhiteSpace(password) && string.IsNullOrWhiteSpace(userPassword)) { inc.SenderConnection.Deny("Password required!"); diff --git a/Subsurface/Source/Screens/ServerListScreen.cs b/Subsurface/Source/Screens/ServerListScreen.cs index 5b2cfb8b5..a49a11579 100644 --- a/Subsurface/Source/Screens/ServerListScreen.cs +++ b/Subsurface/Source/Screens/ServerListScreen.cs @@ -299,18 +299,18 @@ namespace Barotrauma return true; } - public void JoinServer(string ip, bool hasPassword) + public void JoinServer(string ip, bool hasPassword, string msg = "Password required") { - CoroutineManager.StartCoroutine(ConnectToServer(ip, hasPassword)); + CoroutineManager.StartCoroutine(ConnectToServer(ip, hasPassword, msg)); } - private IEnumerable ConnectToServer(string ip, bool hasPassword) + private IEnumerable ConnectToServer(string ip, bool hasPassword, string msg = "Password required") { string selectedPassword = ""; if (hasPassword) { - var msgBox = new GUIMessageBox("Password required:", "", new string[] { "OK", "Cancel" }); + var msgBox = new GUIMessageBox(msg, "", new string[] { "OK", "Cancel" }); var passwordBox = new GUITextBox(new Rectangle(0,40,150,25), Alignment.TopLeft, GUI.Style, msgBox.children[0]); passwordBox.UserData = "password"; diff --git a/Subsurface/changelog.txt b/Subsurface/changelog.txt index 2a46c11fb..e700c7fbd 100644 --- a/Subsurface/changelog.txt +++ b/Subsurface/changelog.txt @@ -1,3 +1,11 @@ +--------------------------------------------------------------------------------------------------------- +v0.3.4.2 +--------------------------------------------------------------------------------------------------------- + +- fixed characters passing through walls/windows that have already been repaired +- fixed the spawn command in Linux version +- fixed clients being able to join servers with the wrong password + --------------------------------------------------------------------------------------------------------- v0.3.4.1 --------------------------------------------------------------------------------------------------------- @@ -12,7 +20,6 @@ of messages received from different clients and discard valid messages - mantises don't bleed - fixed crashing when swapping some specific equipped items with another item in the inventory - fixed deconstructor, fabricator and railgun connection panels closing immediately after opening -- fixed newly created subs being saved to the root folder instead of the Submarines folder --------------------------------------------------------------------------------------------------------- v0.3.4.0 diff --git a/Subsurface/readme.txt b/Subsurface/readme.txt index 0988a32db..9cded686b 100644 --- a/Subsurface/readme.txt +++ b/Subsurface/readme.txt @@ -44,8 +44,8 @@ Credits: ------------------------------------------------------------------------ Programming, graphics, sounds, game design - Joonas Rikkonen ("Regalis") -Graphics - James Bear ("Moonsaber99") -Programming - Sebastian Broberg +Graphics - James Bear ("Moonsaber99") +Programming - Sebastian Broberg ------------------------------------------------------------------------