Add prediction for standing states and mob states (#1937)
This commit is contained in:
@@ -20,6 +20,7 @@ using Content.Shared.GameObjects.Components.Damage;
|
||||
using Content.Shared.GameObjects.Components.Movement;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Reflection;
|
||||
using Robust.Shared.IoC;
|
||||
@@ -38,7 +39,7 @@ namespace Content.Server.GameObjects.Components.Body
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(IDamageableComponent))]
|
||||
[ComponentReference(typeof(IBodyManagerComponent))]
|
||||
[ComponentReference(typeof(ISharedBodyManagerComponent))]
|
||||
public class BodyManagerComponent : SharedBodyManagerComponent, IBodyPartContainer, IRelayMoveInput
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
@@ -289,14 +290,14 @@ namespace Content.Server.GameObjects.Components.Body
|
||||
if (speedSum <= 0.001f || _activeLegs.Count <= 0)
|
||||
{
|
||||
// Case: no way of moving. Fall down.
|
||||
StandingStateHelper.Down(Owner);
|
||||
EntitySystem.Get<StandingStateSystem>().Down(Owner);
|
||||
playerMover.BaseWalkSpeed = 0.8f;
|
||||
playerMover.BaseSprintSpeed = 2.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Case: have at least one leg. Set move speed.
|
||||
StandingStateHelper.Standing(Owner);
|
||||
EntitySystem.Get<StandingStateSystem>().Standing(Owner);
|
||||
|
||||
// Extra legs stack diminishingly.
|
||||
// Final speed = speed sum/(leg count-log4(leg count))
|
||||
|
||||
Reference in New Issue
Block a user