diff --git a/.vs/Subsurface_Solution/v14/.suo b/.vs/Subsurface_Solution/v14/.suo index 36e940095..fab9934e5 100644 Binary files a/.vs/Subsurface_Solution/v14/.suo and b/.vs/Subsurface_Solution/v14/.suo differ diff --git a/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs b/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs index 06b255839..a9b3c1157 100644 --- a/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs +++ b/Subsurface/Source/Characters/Animation/HumanoidAnimController.cs @@ -953,7 +953,7 @@ namespace Barotrauma Vector2 targetMovement = character.GetTargetMovement(); - Vector2 currPosition = prevPosition + targetMovement * timePassed/1000.0f; + Vector2 currPosition = prevPosition + targetMovement * timePassed/500.0f; return currPosition; } diff --git a/Subsurface/Source/Characters/Animation/Ragdoll.cs b/Subsurface/Source/Characters/Animation/Ragdoll.cs index 217bce765..e5ca45086 100644 --- a/Subsurface/Source/Characters/Animation/Ragdoll.cs +++ b/Subsurface/Source/Characters/Animation/Ragdoll.cs @@ -827,7 +827,7 @@ namespace Barotrauma foreach (Limb limb in Limbs) { limb.body.LinearVelocity = Vector2.Zero; - limb.body.AngularVelocity = Vector2.Zero; + limb.body.AngularVelocity = 0.0f; // if (limb.body.TargetPosition == Vector2.Zero) // { // limb.body.SetTransform(limb.body.SimPosition + diff, limb.body.Rotation); diff --git a/Subsurface/Source/Events/MonsterEvent.cs b/Subsurface/Source/Events/MonsterEvent.cs index 3f2d316b6..3550ede4d 100644 --- a/Subsurface/Source/Events/MonsterEvent.cs +++ b/Subsurface/Source/Events/MonsterEvent.cs @@ -25,6 +25,11 @@ namespace Barotrauma spawnDeep = ToolBox.GetAttributeBool(element, "spawndeep", false); } + protected override void Start() + { + SpawnMonsters(); + } + private void SpawnMonsters() { WayPoint randomWayPoint = WayPoint.GetRandom(SpawnType.Enemy); @@ -63,13 +68,13 @@ namespace Barotrauma { if (monsters[i].IsDead) continue; - if (!isStarted && monsters[i].SimPosition != Vector2.Zero && monsters[i].SimPosition.Length() < 20.0) isStarted = true; + if (!isStarted && Vector2.Distance(monsters[i].WorldPosition, Submarine.Loaded.WorldPosition) < 5000.0f) isStarted = true; monstersDead = false; break; } - if (monstersDead) Finished(); + if (monstersDead) Finished(); } } } diff --git a/Subsurface/Source/Networking/NetworkEvent.cs b/Subsurface/Source/Networking/NetworkEvent.cs index c0d4e3a5e..17e22e8d7 100644 --- a/Subsurface/Source/Networking/NetworkEvent.cs +++ b/Subsurface/Source/Networking/NetworkEvent.cs @@ -125,7 +125,7 @@ namespace Barotrauma.Networking public bool FillData(NetBuffer message) { - message.Write((byte)eventType); + message.WriteRangedInteger(0, Enum.GetValues(typeof(NetworkEventType)).Length, (int)eventType); Entity e = Entity.FindEntityByID(id); if (e == null) return false; @@ -182,7 +182,7 @@ namespace Barotrauma.Networking try { - eventType = (NetworkEventType)message.ReadByte(); + eventType = (NetworkEventType)message.ReadRangedInteger(0, Enum.GetValues(typeof(NetworkEventType)).Length); id = message.ReadUInt16(); } catch diff --git a/Subsurface/Source/Networking/ReliableSender.cs b/Subsurface/Source/Networking/ReliableSender.cs index c535f1a4e..3bd660632 100644 --- a/Subsurface/Source/Networking/ReliableSender.cs +++ b/Subsurface/Source/Networking/ReliableSender.cs @@ -188,7 +188,9 @@ namespace Barotrauma.Networking.ReliableMessages sender.SendMessage(message, recipient, NetDeliveryMethod.Unreliable); - idSendTimer = Math.Max(recipient.AverageRoundtripTime, NetConfig.IdSendInterval+idSendInterval); + float roundTripTime = Math.Min(recipient.AverageRoundtripTime, 0.5f); + + idSendTimer = Math.Max(roundTripTime, NetConfig.IdSendInterval+idSendInterval); idSendInterval += 0.1f; } } @@ -246,8 +248,9 @@ namespace Barotrauma.Networking.ReliableMessages receiver.SendMessage(resendRequest, recipient, missingMessage.ResendRequestsSent==0 ? NetDeliveryMethod.ReliableUnordered : NetDeliveryMethod.Unreliable); + float roundTripTime = Math.Min(recipient.AverageRoundtripTime, 0.5f); - missingMessage.ResendTimer = Math.Max(recipient.AverageRoundtripTime, NetConfig.RerequestInterval); + missingMessage.ResendTimer = Math.Max(roundTripTime, NetConfig.RerequestInterval); missingMessage.ResendRequestsSent++; }