Resolve 'TransformComponent.MapPosition' is obsolete in content (#27939)

* Resolve `'TransformComponent.MapPosition' is obsolete: 'Use TransformSystem.GetMapCoordinates'` in content

* build?
This commit is contained in:
Kara
2024-05-12 07:31:54 -07:00
committed by GitHub
parent 8938e1d8b2
commit 855234aa30
59 changed files with 152 additions and 84 deletions

View File

@@ -31,6 +31,7 @@ using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Utility;
using System.Linq;
using Robust.Server.GameObjects;
namespace Content.Server.Nutrition.EntitySystems;
@@ -52,6 +53,7 @@ public sealed class FoodSystem : EntitySystem
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly TransformSystem _transform = default!;
[Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly StomachSystem _stomach = default!;
[Dependency] private readonly UtensilSystem _utensil = default!;
@@ -150,7 +152,7 @@ public sealed class FoodSystem : EntitySystem
return (false, true);
// TODO make do-afters account for fixtures in the range check.
if (!Transform(user).MapPosition.InRange(Transform(target).MapPosition, MaxFeedDistance))
if (!_transform.GetMapCoordinates(user).InRange(_transform.GetMapCoordinates(target), MaxFeedDistance))
{
var message = Loc.GetString("interaction-system-user-interaction-cannot-reach");
_popup.PopupEntity(message, user, user);
@@ -325,7 +327,7 @@ public sealed class FoodSystem : EntitySystem
}
//We're empty. Become trash.
var position = Transform(food).MapPosition;
var position = _transform.GetMapCoordinates(food);
var finisher = Spawn(component.Trash, position);
// If the user is holding the item