diff --git a/Subsurface/Source/Characters/Animation/Ragdoll.cs b/Subsurface/Source/Characters/Animation/Ragdoll.cs index 47e6f52d0..d08e1f80c 100644 --- a/Subsurface/Source/Characters/Animation/Ragdoll.cs +++ b/Subsurface/Source/Characters/Animation/Ragdoll.cs @@ -460,7 +460,7 @@ namespace Barotrauma pos.Y = -pos.Y; GUI.DrawRectangle(spriteBatch, new Rectangle((int)pos.X - 10, (int)pos.Y - 10, 20, 20), Color.Cyan, false, 0.01f); - GUI.DrawLine(spriteBatch, pos, new Vector2(limb.Position.X, -limb.Position.Y), limb == RefLimb ? Color.Orange : Color.Cyan); + GUI.DrawLine(spriteBatch, pos, new Vector2(limb.WorldPosition.X, -limb.WorldPosition.Y), limb == RefLimb ? Color.Orange : Color.Cyan); } } @@ -794,7 +794,7 @@ namespace Barotrauma limb.body.TargetPosition = Vector2.Zero; } - correctionMovement = Vector2.Zero; + correctionMovement = targetMovement; return; } else @@ -818,10 +818,19 @@ namespace Barotrauma } else { + //clamp the magnitude of the correction movement between 0.5f - 5.0f Vector2 newCorrectionMovement = Vector2.Normalize(diff) * MathHelper.Clamp(dist * 5.0f, 0.5f, 5.0f); - newCorrectionMovement.X = Math.Max(newCorrectionMovement.X, 0.5f) * Math.Sign(newCorrectionMovement.X); - correctionMovement = Vector2.Lerp(targetMovement, newCorrectionMovement, 0.2f); + //heading in the right direction -> use the ''normal'' movement if it's faster than correctionMovement + //i.e. the character is close to the targetposition but the character is still running + if (Math.Sign(targetMovement.X)==Math.Sign(newCorrectionMovement.X)) + { + newCorrectionMovement.X = Math.Max(Math.Abs(targetMovement.X), Math.Abs(newCorrectionMovement.X)) * Math.Sign(targetMovement.X); + } + + //newCorrectionMovement.X = Math.Max(newCorrectionMovement.X, 0.5f) * Math.Sign(newCorrectionMovement.X); + + correctionMovement = Vector2.Lerp(correctionMovement, newCorrectionMovement, 0.5f); if (Math.Abs(correctionMovement.Y) < 0.1f) correctionMovement.Y = 0.0f; } diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index 417abdda3..44ab1ae9c 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -600,7 +600,7 @@ namespace Barotrauma AnimController.TargetMovement = targetMovement; - AnimController.IgnorePlatforms = targetMovement.Y < 0.0f; + AnimController.IgnorePlatforms = AnimController.TargetMovement.Y < 0.0f; if (AnimController.onGround && !AnimController.InWater && diff --git a/Subsurface/Source/Events/Quests/MonsterQuest.cs b/Subsurface/Source/Events/Quests/MonsterQuest.cs index d315babaa..cba33be31 100644 --- a/Subsurface/Source/Events/Quests/MonsterQuest.cs +++ b/Subsurface/Source/Events/Quests/MonsterQuest.cs @@ -43,7 +43,7 @@ namespace Barotrauma { radarPosition = monster.Position; } - else + else if (GameMain.Client == null) { Vector2 diff = monster.WorldPosition-Submarine.Loaded.WorldPosition; monster.Enabled = FarseerPhysics.ConvertUnits.ToSimUnits(diff.Length()) < NetConfig.CharacterIgnoreDistance; } diff --git a/Subsurface/Source/Networking/GameServer.cs b/Subsurface/Source/Networking/GameServer.cs index 143c2e9c8..a1ddbcf48 100644 --- a/Subsurface/Source/Networking/GameServer.cs +++ b/Subsurface/Source/Networking/GameServer.cs @@ -817,7 +817,7 @@ namespace Barotrauma.Networking gameStarted = true; - GameMain.GameScreen.Cam.TargetPos = Submarine.Loaded.Position; + GameMain.GameScreen.Cam.TargetPos = Vector2.Zero; GameMain.GameScreen.Select(); diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 1f8d22e37..355cb5e2a 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ