Fixes movement and throwing incorrect tick-rate scaling (#1162)

* fixes movement and throwing scaling incorrectly w/ tick rate

* Update Content.Server/GameObjects/EntitySystems/MoverSystem.cs
This commit is contained in:
Tyler Young
2020-06-24 12:41:31 -04:00
committed by GitHub
parent 623e47f19d
commit b92a2ba4e6
2 changed files with 9 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
using Content.Server.GameObjects.Components;
using System;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Movement;
using Content.Server.GameObjects.Components.Sound;
@@ -131,16 +132,16 @@ namespace Content.Server.GameObjects.EntitySystems
var physics = entity.GetComponent<PhysicsComponent>();
if (entity.TryGetComponent<CollidableComponent>(out var collider))
{
UpdateKinematics(entity.Transform, mover, physics, collider);
UpdateKinematics(entity.Transform, mover, physics, frameTime, collider);
}
else
{
UpdateKinematics(entity.Transform, mover, physics);
UpdateKinematics(entity.Transform, mover, physics, frameTime);
}
}
}
private void UpdateKinematics(ITransformComponent transform, IMoverComponent mover, PhysicsComponent physics, CollidableComponent collider = null)
private void UpdateKinematics(ITransformComponent transform, IMoverComponent mover, PhysicsComponent physics, float frameTime, CollidableComponent collider = null)
{
if (physics.Controller == null)
{