MapManager warning cleanup shared edition (#36795)
* cleanup and reworking * one of these days I'll merge a conflict without breaking shit. * Update Content.Shared/Shuttles/Systems/SharedShuttleSystem.cs Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * Update Content.Shared/Tabletop/SharedTabletopSystem.cs Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * I'm gonna send this but... I'll be honest, I dunno what it does. * fix coordinates --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -7,7 +7,6 @@ using Content.Shared.Mind.Components;
|
|||||||
using Content.Shared.Mobs.Systems;
|
using Content.Shared.Mobs.Systems;
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Map;
|
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
|
|||||||
@@ -276,13 +276,9 @@ public abstract class SharedMagicSystem : EntitySystem
|
|||||||
|
|
||||||
// If applicable, this ensures the projectile is parented to grid on spawn, instead of the map.
|
// If applicable, this ensures the projectile is parented to grid on spawn, instead of the map.
|
||||||
var fromMap = _transform.ToMapCoordinates(fromCoords);
|
var fromMap = _transform.ToMapCoordinates(fromCoords);
|
||||||
var spawnCoords = _mapManager.TryFindGridAt(fromMap, out var gridUid, out _)
|
var ent = Spawn(ev.Prototype, fromMap);
|
||||||
? _transform.WithEntityId(fromCoords, gridUid)
|
|
||||||
: new(_mapManager.GetMapEntityId(fromMap.MapId), fromMap.Position);
|
|
||||||
|
|
||||||
var ent = Spawn(ev.Prototype, spawnCoords);
|
|
||||||
var direction = _transform.ToMapCoordinates(toCoords).Position -
|
var direction = _transform.ToMapCoordinates(toCoords).Position -
|
||||||
_transform.ToMapCoordinates(spawnCoords).Position;
|
fromMap.Position;
|
||||||
_gunSystem.ShootProjectile(ent, direction, userVelocity, ev.Performer, ev.Performer);
|
_gunSystem.ShootProjectile(ent, direction, userVelocity, ev.Performer, ev.Performer);
|
||||||
}
|
}
|
||||||
// End Projectile Spells
|
// End Projectile Spells
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public abstract partial class SharedShuttleSystem : EntitySystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool CanFTLTo(EntityUid shuttleUid, MapId targetMap, EntityUid consoleUid)
|
public bool CanFTLTo(EntityUid shuttleUid, MapId targetMap, EntityUid consoleUid)
|
||||||
{
|
{
|
||||||
var mapUid = _mapManager.GetMapEntityId(targetMap);
|
var mapUid = Maps.GetMapOrInvalid(targetMap);
|
||||||
var shuttleMap = _xformQuery.GetComponent(shuttleUid).MapID;
|
var shuttleMap = _xformQuery.GetComponent(shuttleUid).MapID;
|
||||||
|
|
||||||
if (shuttleMap == targetMap)
|
if (shuttleMap == targetMap)
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using Content.Shared.Hands.Components;
|
|||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Tabletop.Components;
|
using Content.Shared.Tabletop.Components;
|
||||||
using Content.Shared.Tabletop.Events;
|
using Content.Shared.Tabletop.Events;
|
||||||
using Robust.Shared.Map;
|
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
@@ -16,8 +15,8 @@ namespace Content.Shared.Tabletop
|
|||||||
[Dependency] protected readonly ActionBlockerSystem ActionBlockerSystem = default!;
|
[Dependency] protected readonly ActionBlockerSystem ActionBlockerSystem = default!;
|
||||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||||
|
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
|
||||||
[Dependency] protected readonly SharedTransformSystem Transforms = default!;
|
[Dependency] protected readonly SharedTransformSystem Transforms = default!;
|
||||||
[Dependency] private readonly IMapManager _mapMan = default!;
|
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -41,7 +40,7 @@ namespace Content.Shared.Tabletop
|
|||||||
|
|
||||||
// Move the entity and dirty it (we use the map ID from the entity so noone can try to be funny and move the item to another map)
|
// Move the entity and dirty it (we use the map ID from the entity so noone can try to be funny and move the item to another map)
|
||||||
var transform = EntityManager.GetComponent<TransformComponent>(moved);
|
var transform = EntityManager.GetComponent<TransformComponent>(moved);
|
||||||
Transforms.SetParent(moved, transform, _mapMan.GetMapEntityId(transform.MapID));
|
Transforms.SetParent(moved, transform, _mapSystem.GetMapOrInvalid(transform.MapID));
|
||||||
Transforms.SetLocalPositionNoLerp(moved, msg.Coordinates.Position, transform);
|
Transforms.SetLocalPositionNoLerp(moved, msg.Coordinates.Position, transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user