Fixed deceleration bug in BaseSpeed property

This commit is contained in:
OverflowNarhoym
2022-02-22 19:05:14 +01:00
parent bc517038e8
commit 9160a0092a
2 changed files with 28 additions and 25 deletions

View File

@@ -137,9 +137,12 @@ namespace Player
get => speed;
set
{
speed = value;
if (speed > MaxSpeed)
speed = MaxSpeed;
speed = speed switch
{
> MaxSpeed => MaxSpeed,
< 0 => 0,
_ => value
};
}
}