Replace xform.WorldPosition with xformSystem method for Setting/Getting (#30029)
* GET WORLD POSITON, ROTATION * Missing parentheses * ui system depndency * the issue * Unused * Let the function do the transform --------- Co-authored-by: plykiya <plykiya@protonmail.com>
This commit is contained in:
@@ -18,6 +18,7 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
|
||||
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly InputSystem _inputSystem = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
|
||||
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
@@ -62,11 +63,11 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
|
||||
if (_dragging == null) return;
|
||||
|
||||
if (_lastMousePosition != null && TryComp(_dragging.Value, out TransformComponent? xform) &&
|
||||
TryComp<PhysicsComponent>(_dragging.Value, out var body) &&
|
||||
TryComp<PhysicsComponent>(_dragging.Value, out _) &&
|
||||
xform.MapID == _lastMousePosition.Value.MapId)
|
||||
{
|
||||
var tickTime = _gameTiming.TickPeriod;
|
||||
var distance = _lastMousePosition.Value.Position - xform.WorldPosition;
|
||||
var distance = _lastMousePosition.Value.Position - _transformSystem.GetWorldPosition(xform);
|
||||
RaiseNetworkEvent(new GridDragVelocityRequest()
|
||||
{
|
||||
Grid = GetNetEntity(_dragging.Value),
|
||||
|
||||
Reference in New Issue
Block a user