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:
Princess Cheeseballs 2026-04-24 02:17:29 -07:00 • committed by GitHub
parent 7367a83807
commit fd4e19e2ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);