Separate jetpack movement speed modifier (#9363)
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
|
||||
namespace Content.Shared.Nutrition.EntitySystems
|
||||
{
|
||||
public sealed class SharedHungerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedJetpackSystem _jetpack = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -14,6 +16,9 @@ namespace Content.Shared.Nutrition.EntitySystems
|
||||
|
||||
private void OnRefreshMovespeed(EntityUid uid, SharedHungerComponent component, RefreshMovementSpeedModifiersEvent args)
|
||||
{
|
||||
if (_jetpack.IsUserFlying(component.Owner))
|
||||
return;
|
||||
|
||||
float mod = component.CurrentHungerThreshold <= HungerThreshold.Starving ? 0.75f : 1.0f;
|
||||
args.ModifySpeed(mod, mod);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user