mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Air Friction changes for Mobs that can move in air (#38691)
* Very minor change * Query * Fix * It should already be static? Why is the test failing * WRONG BRANCH --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
parent
7367a83807
commit
fd4e19e2ee
1 changed files with 3 additions and 3 deletions
|
|
@ -2,7 +2,6 @@ using System.Numerics;
|
|||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Gravity;
|
||||
using Content.Shared.Interaction.Components;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Content.Shared.Movement.Pulling.Components;
|
||||
|
|
@ -28,6 +27,7 @@ namespace Content.Shared.Friction
|
|||
[Dependency] private readonly SharedMoverController _mover = default!;
|
||||
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||
|
||||
[Dependency] private readonly EntityQuery<CanMoveInAirComponent> _canMoveInAirQuery = default!;
|
||||
[Dependency] private readonly EntityQuery<TileFrictionModifierComponent> _frictionQuery = default!;
|
||||
[Dependency] private readonly EntityQuery<PullerComponent> _pullerQuery = default!;
|
||||
[Dependency] private readonly EntityQuery<PullableComponent> _pullableQuery = default!;
|
||||
|
|
@ -73,8 +73,8 @@ namespace Content.Shared.Friction
|
|||
float friction;
|
||||
|
||||
// If we're not touching the ground, don't use tileFriction.
|
||||
// TODO: Make IsWeightless event-based; we already have grid traversals tracked so just raise events
|
||||
if (body.BodyStatus == BodyStatus.InAir || _gravity.IsWeightless(uid) || !xform.Coordinates.IsValid(EntityManager))
|
||||
if (body.BodyStatus != BodyStatus.OnGround && !_canMoveInAirQuery.HasComp(uid)
|
||||
|| _gravity.IsWeightless(uid) || !xform.Coordinates.IsValid(EntityManager))
|
||||
friction = xform.GridUid == null || !_gridQuery.HasComp(xform.GridUid) ? _offGridDamping : _airDamping;
|
||||
else
|
||||
friction = _frictionModifier * GetTileFriction(uid, body, xform);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue