Content changes required for physicsmap purge (#37878)

* PhysMap changes

* Fix call

* Avoid tilefriction resolve

yummy

* a
This commit is contained in:
metalgearsloth
2025-05-28 19:38:47 +10:00
committed by GitHub
parent 10dee14893
commit ea7350f3f1
41 changed files with 48 additions and 124 deletions

View File

@@ -51,13 +51,14 @@ namespace Content.Shared.Friction
_gridQuery = GetEntityQuery<MapGridComponent>();
}
public override void UpdateBeforeMapSolve(bool prediction, PhysicsMapComponent mapComponent, float frameTime)
public override void UpdateBeforeSolve(bool prediction, float frameTime)
{
base.UpdateBeforeMapSolve(prediction, mapComponent, frameTime);
base.UpdateBeforeSolve(prediction, frameTime);
foreach (var body in mapComponent.AwakeBodies)
foreach (var ent in PhysicsSystem.AwakeBodies)
{
var uid = body.Owner;
var uid = ent.Owner;
var body = ent.Comp1;
// Only apply friction when it's not a mob (or the mob doesn't have control)
// We may want to instead only apply friction to dynamic entities and not mobs ever.
@@ -67,12 +68,7 @@ namespace Content.Shared.Friction
if (body.LinearVelocity.Equals(Vector2.Zero) && body.AngularVelocity.Equals(0f))
continue;
if (!_xformQuery.TryGetComponent(uid, out var xform))
{
Log.Error($"Unable to get transform for {ToPrettyString(uid)} in tilefrictioncontroller");
continue;
}
var xform = ent.Comp2;
float friction;
// If we're not touching the ground, don't use tileFriction.