Fix bullets crashing the server.

This is not a proper fix. A proper fix would be a better physics engine.

But as it stands I really wanna get a progress report out and having to refactor physics to do it would just suck.
This commit is contained in:
Pieter-Jan Briers
2019-12-29 01:06:57 +01:00
parent 6d8bfcc7bb
commit 259f6c8ea4
2 changed files with 14 additions and 0 deletions
@@ -110,6 +110,13 @@ namespace Robust.Server.GameObjects.EntitySystems
private static void DoMovement(IEntity entity, float frameTime)
{
// TODO: Terrible hack to fix bullets crashing the server.
// Should be handled with deferred physics events instead.
if (entity.Deleted)
{
return;
}
var velocity = entity.GetComponent<PhysicsComponent>();
if (velocity.LinearVelocity.LengthSquared < Epsilon && velocity.AngularVelocity < Epsilon)