Refactor slip dropping to use throwing (#5476)

* Refactor slip dropping to use throwing

* Update Content.Server/Fluids/EntitySystems/SpillableSystem.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* Uncringe

* Update Content.Server/Fluids/EntitySystems/SpillableSystem.cs

Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
This commit is contained in:
Clyybber
2021-11-24 00:38:39 +01:00
committed by GitHub
parent ee27c75224
commit 0e98c1c524
10 changed files with 113 additions and 121 deletions

View File

@@ -33,7 +33,6 @@ namespace Content.Server.Throwing
internal static void TryThrow(this IEntity entity, Vector2 direction, float strength = 1.0f, IEntity? user = null, float pushbackRatio = 1.0f)
{
if (entity.Deleted ||
direction == Vector2.Zero ||
strength <= 0f ||
!entity.TryGetComponent(out PhysicsComponent? physicsComponent))
{
@@ -61,7 +60,7 @@ namespace Content.Server.Throwing
{
physicsComponent.ApplyAngularImpulse(ThrowAngularImpulse);
}
else
else if(direction != Vector2.Zero)
{
entity.Transform.LocalRotation = direction.ToWorldAngle() - Math.PI;
}
@@ -79,6 +78,7 @@ namespace Content.Server.Throwing
if (time < FlyTime)
{
physicsComponent.BodyStatus = BodyStatus.OnGround;
EntitySystem.Get<ThrownItemSystem>().LandComponent(comp);
}
else
{