diff --git a/Content.Server/Administration/Systems/BwoinkSystem.cs b/Content.Server/Administration/Systems/BwoinkSystem.cs index ed15b917cc..0528aa2ac2 100644 --- a/Content.Server/Administration/Systems/BwoinkSystem.cs +++ b/Content.Server/Administration/Systems/BwoinkSystem.cs @@ -826,8 +826,8 @@ namespace Content.Server.Administration.Systems bwoinkText = $"{(message.AdminOnly ? Loc.GetString("bwoink-message-admin-only") : !message.PlaySound ? Loc.GetString("bwoink-message-silent") : "")} {bwoinkText}: {escapedText}"; // If it's not an admin / admin chooses to keep the sound and message is not an admin only message, then play it. - var playSound = (!senderAHelpAdmin || message.PlaySound) && !message.AdminOnly; - var msg = new BwoinkTextMessage(message.UserId, senderSession.UserId, bwoinkText, playSound: playSound, adminOnly: message.AdminOnly); + var playSound = (senderAdmin == null || message.PlaySound) && !message.AdminOnly; + var msg = new BwoinkTextMessage(message.UserId, senderId, bwoinkText, playSound: playSound, adminOnly: message.AdminOnly); LogBwoink(msg); diff --git a/Content.Server/Nyanotrasen/Psionics/Glimmer/GlimmerReactiveSystem.cs b/Content.Server/Nyanotrasen/Psionics/Glimmer/GlimmerReactiveSystem.cs index 6123427939..6a1775d349 100644 --- a/Content.Server/Nyanotrasen/Psionics/Glimmer/GlimmerReactiveSystem.cs +++ b/Content.Server/Nyanotrasen/Psionics/Glimmer/GlimmerReactiveSystem.cs @@ -341,9 +341,8 @@ namespace Content.Server.Psionics.Glimmer _lightning.ShootRandomLightnings(uid, 10, 2, "SuperchargedLightning", 2, false); // Check if the parent of the user is alive, which will be the case if the user is an item and is being held. - var zapTarget = _transform.GetParentUid(args.User); - if (TryComp(zapTarget, out _)) - _electrocutionSystem.TryDoElectrocution(zapTarget, uid, 5, TimeSpan.FromSeconds(3), true, + if (args.User is {} user && HasComp(args.User)) + _electrocutionSystem.TryDoElectrocution(user, uid, 5, TimeSpan.FromSeconds(3), true, ignoreInsulation: true); } diff --git a/Content.Server/Salvage/SalvageSystem.Magnet.cs b/Content.Server/Salvage/SalvageSystem.Magnet.cs index 8269f9ee8a..d99a90cb58 100644 --- a/Content.Server/Salvage/SalvageSystem.Magnet.cs +++ b/Content.Server/Salvage/SalvageSystem.Magnet.cs @@ -46,11 +46,12 @@ public sealed partial class SalvageSystem } var index = args.Index; + var user = args.Actor; // DeltaV async void TryTakeMagnetOffer() { try { - await TakeMagnetOffer((station.Value, dataComp), index, (uid, component), args.Actor); // DeltaV: pass the user entity + await TakeMagnetOffer((station.Value, dataComp), index, (uid, component), user); // DeltaV: pass the user } catch (Exception e) { diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs index 2f68510750..c2ea39c702 100644 --- a/Content.Server/Station/Systems/StationSpawningSystem.cs +++ b/Content.Server/Station/Systems/StationSpawningSystem.cs @@ -3,6 +3,7 @@ using Content.Server.Humanoid; using Content.Server.IdentityManagement; using Content.Server.Mind.Commands; using Content.Server.PDA; +using Content.Server.Spawners.Components; // DeltaV using Content.Server.Station.Components; using Content.Shared.Access.Components; using Content.Shared.Access.Systems; diff --git a/Content.Server/_DV/Planet/PlanetSystem.cs b/Content.Server/_DV/Planet/PlanetSystem.cs index c41be09784..076e863d05 100644 --- a/Content.Server/_DV/Planet/PlanetSystem.cs +++ b/Content.Server/_DV/Planet/PlanetSystem.cs @@ -2,10 +2,11 @@ using Content.Server.Atmos.EntitySystems; using Content.Server.Parallax; using Content.Shared._DV.Planet; using Content.Shared.Parallax.Biomes; -using Robust.Server.GameObjects; +using Robust.Shared.EntitySerialization.Systems; using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Prototypes; +using Robust.Shared.Utility; namespace Content.Server._DV.Planet; @@ -14,9 +15,9 @@ public sealed class PlanetSystem : EntitySystem [Dependency] private readonly AtmosphereSystem _atmos = default!; [Dependency] private readonly BiomeSystem _biome = default!; [Dependency] private readonly IPrototypeManager _proto = default!; - [Dependency] private readonly MapSystem _map = default!; [Dependency] private readonly MapLoaderSystem _mapLoader = default!; [Dependency] private readonly MetaDataSystem _meta = default!; + [Dependency] private readonly SharedMapSystem _map = default!; private readonly List<(Vector2i, Tile)> _setTiles = new(); @@ -51,11 +52,11 @@ public sealed class PlanetSystem : EntitySystem /// Spawns an initialized planet map from a planet prototype and loads a grid onto it. /// Returns the map entity if loading succeeded. /// - public EntityUid? LoadPlanet(ProtoId id, string path) + public EntityUid? LoadPlanet(ProtoId id, ResPath path) { var map = SpawnPlanet(id, runMapInit: false); var mapId = Comp(map).MapId; - if (!_mapLoader.TryLoad(mapId, path, out var grids)) + if (!_mapLoader.TryLoadMapWithId(mapId, path, out _, out var grids)) { Log.Error($"Failed to load planet grid {path} for planet {id}!"); Del(map); diff --git a/Content.Server/_DV/Shipyard/ShipyardSystem.cs b/Content.Server/_DV/Shipyard/ShipyardSystem.cs index 664f1e8748..f33811b944 100644 --- a/Content.Server/_DV/Shipyard/ShipyardSystem.cs +++ b/Content.Server/_DV/Shipyard/ShipyardSystem.cs @@ -4,8 +4,10 @@ using Content.Server.Station.Components; using Content.Server.Station.Systems; using Content.Shared._DV.CCVars; using Content.Shared.Tag; -using Robust.Server.GameObjects; +using Robust.Shared.EntitySerialization.Systems; using Robust.Shared.Configuration; +using Robust.Shared.Prototypes; +using Robust.Shared.Utility; namespace Content.Server.Shipyard; @@ -16,13 +18,12 @@ public sealed class ShipyardSystem : EntitySystem { [Dependency] private readonly IConfigurationManager _config = default!; [Dependency] private readonly MapDeleterShuttleSystem _mapDeleterShuttle = default!; - [Dependency] private readonly MapSystem _map = default!; [Dependency] private readonly MapLoaderSystem _mapLoader = default!; + [Dependency] private readonly SharedMapSystem _map = default!; [Dependency] private readonly ShuttleSystem _shuttle = default!; [Dependency] private readonly StationSystem _station = default!; - [ValidatePrototypeId] - public string DockTag = "DockShipyard"; + public ProtoId DockTag = "DockShipyard"; public bool Enabled; @@ -41,24 +42,15 @@ public sealed class ShipyardSystem : EntitySystem if (!Enabled) return null; - if (!_mapLoader.TryLoad(mapId, path, out var map, out var grids)) + var map = _map.CreateMap(out var mapId); + if (!_mapLoader.TryLoadGrid(mapId, path, out var grid)) { Log.Error($"Failed to load shuttle {path}"); Del(map); return null; } - // only 1 grid is supported, no tramshuttle - if (grids.Count != 1) - { - var error = grids.Count < 1 ? "less" : "more"; - Log.Error($"Shuttle {path} had {error} than 1 grid, which is not supported."); - Del(map); - return null; - } - - var uid = grids[0]; - if (!TryComp(uid, out var comp)) + if (!TryComp(grid, out var comp)) { Log.Error($"Shuttle {path}'s grid was missing ShuttleComponent"); Del(map); @@ -66,8 +58,8 @@ public sealed class ShipyardSystem : EntitySystem } _map.SetPaused(map, false); - _mapDeleterShuttle.Enable(uid); - return (uid, comp); + _mapDeleterShuttle.Enable(grid.Value); + return (grid.Value, comp); } /// diff --git a/Content.Server/_DV/Station/Systems/StationPlanetSpawnerSystem.cs b/Content.Server/_DV/Station/Systems/StationPlanetSpawnerSystem.cs index ced0a82721..c05e392196 100644 --- a/Content.Server/_DV/Station/Systems/StationPlanetSpawnerSystem.cs +++ b/Content.Server/_DV/Station/Systems/StationPlanetSpawnerSystem.cs @@ -20,7 +20,7 @@ public sealed class StationPlanetSpawnerSystem : EntitySystem if (ent.Comp.GridPath is not {} path) return; - ent.Comp.Map = _planet.LoadPlanet(ent.Comp.Planet, path.ToString()); + ent.Comp.Map = _planet.LoadPlanet(ent.Comp.Planet, path); } private void OnShutdown(Entity ent, ref ComponentShutdown args) diff --git a/Content.Server/_DV/StationEvents/Events/DebrisSpawnerRule.cs b/Content.Server/_DV/StationEvents/Events/DebrisSpawnerRule.cs index 41e0742fd3..772ed6ce12 100644 --- a/Content.Server/_DV/StationEvents/Events/DebrisSpawnerRule.cs +++ b/Content.Server/_DV/StationEvents/Events/DebrisSpawnerRule.cs @@ -9,9 +9,8 @@ using Content.Server.Station.Components; using Content.Server.StationEvents.Components; using Content.Shared.CCVar; using Content.Shared.Salvage; -using Robust.Server.GameObjects; -using Robust.Server.Maps; using Robust.Shared.Configuration; +using Robust.Shared.EntitySerialization.Systems; using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Prototypes; @@ -58,14 +57,8 @@ public sealed class DebrisSpawnerRule : StationEventSystem(gridId); - var gridAabb = Transform(gridId).WorldMatrix.TransformBox(grid.LocalAABB); + var gridComp = Comp(gridId); + var gridAabb = Transform(gridId).WorldMatrix.TransformBox(gridComp.LocalAABB); aabb = aabb.Union(gridAabb); } @@ -50,23 +49,16 @@ public sealed class LoadFarGridRule : StationEventSystem>(OnTryAccessFingerprint); } - private void OnTryAccessFingerprint(EntityUid uid, FingerprintMaskComponent comp, ref InventoryRelayedEvent args) + private void OnTryAccessFingerprint(Entity ent, ref InventoryRelayedEvent args) { - args.Args.Blocker = uid; + args.Args.Blocker = ent; args.Args.Cancel(); } } diff --git a/Content.Shared/_DV/VendingMachines/ShopVendorComponent.cs b/Content.Shared/_DV/VendingMachines/ShopVendorComponent.cs index 5638af6802..090720ea54 100644 --- a/Content.Shared/_DV/VendingMachines/ShopVendorComponent.cs +++ b/Content.Shared/_DV/VendingMachines/ShopVendorComponent.cs @@ -44,10 +44,10 @@ public sealed partial class ShopVendorComponent : Component [DataField] public TimeSpan EjectDelay = TimeSpan.FromSeconds(1.2); - [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] + [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField] public TimeSpan NextDeny; - [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] + [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField] public TimeSpan NextEject; [DataField]