Landing velocity threshold (#4606)
* landing threshold * on bodystatus change Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -52,9 +52,10 @@ namespace Content.Server.Throwing
|
||||
return;
|
||||
}
|
||||
|
||||
var comp = entity.EnsureComponent<ThrownItemComponent>();
|
||||
if (entity.HasComponent<ItemComponent>())
|
||||
{
|
||||
entity.EnsureComponent<ThrownItemComponent>().Thrower = user;
|
||||
comp.Thrower = user;
|
||||
// Give it a l'il spin.
|
||||
if (!entity.HasTag("NoSpinOnThrow"))
|
||||
{
|
||||
@@ -71,7 +72,7 @@ namespace Content.Server.Throwing
|
||||
|
||||
var impulseVector = direction.Normalized * strength * physicsComponent.Mass;
|
||||
physicsComponent.ApplyLinearImpulse(impulseVector);
|
||||
|
||||
|
||||
// Estimate time to arrival so we can apply OnGround status and slow it much faster.
|
||||
var time = (direction / strength).Length;
|
||||
|
||||
@@ -87,6 +88,7 @@ namespace Content.Server.Throwing
|
||||
{
|
||||
if (physicsComponent.Deleted) return;
|
||||
physicsComponent.BodyStatus = BodyStatus.OnGround;
|
||||
EntitySystem.Get<ThrownItemSystem>().LandComponent(comp);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user