Fix replayghost spawning location (#30252)

Fix replayghost spawn
This commit is contained in:
Errant
2024-07-22 21:32:30 +02:00
committed by GitHub
parent 61fd8167e0
commit bf1450fdc8
18 changed files with 40 additions and 28 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.Movement.Components; using Content.Shared.Movement.Components;
using Content.Shared.Station.Components;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;
@@ -164,14 +165,25 @@ public sealed partial class ReplaySpectatorSystem
float? maxSize = null; float? maxSize = null;
var gridQuery = EntityQueryEnumerator<MapGridComponent>(); var gridQuery = EntityQueryEnumerator<MapGridComponent>();
var stationFound = false;
while (gridQuery.MoveNext(out var uid, out var grid)) while (gridQuery.MoveNext(out var uid, out var grid))
{ {
var size = grid.LocalAABB.Size.LengthSquared(); var size = grid.LocalAABB.Size.LengthSquared();
if (maxSize == null || size > maxSize)
{ if (maxSize is not null && size < maxSize)
continue;
var station = HasComp<StationMemberComponent>(uid);
if (!station && stationFound)
continue;
maxUid = (uid, grid); maxUid = (uid, grid);
maxSize = size; maxSize = size;
}
if (station)
stationFound = true;
} }
coords = new EntityCoordinates(maxUid ?? default, default); coords = new EntityCoordinates(maxUid ?? default, default);

View File

@@ -18,6 +18,7 @@ using Content.Shared.Hands.Components;
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Content.Shared.NPC.Systems; using Content.Shared.NPC.Systems;
using Content.Shared.NukeOps; using Content.Shared.NukeOps;
using Content.Shared.Station.Components;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;

View File

@@ -16,6 +16,7 @@ using Robust.Shared.GameObjects;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Content.Shared.Station.Components;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel; using YamlDotNet.RepresentationModel;

View File

@@ -1,5 +1,5 @@
using System.Text.Json; using System.Text.Json;
using Content.Server.Station.Components; using Content.Shared.Station.Components;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;

View File

@@ -3,11 +3,11 @@ using Content.Server.Audio;
using Content.Server.Light.Components; using Content.Server.Light.Components;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Server.Station.Components;
using Content.Server.Station.Systems; using Content.Server.Station.Systems;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Light; using Content.Shared.Light;
using Content.Shared.Light.Components; using Content.Shared.Light.Components;
using Content.Shared.Station.Components;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Color = Robust.Shared.Maths.Color; using Color = Robust.Shared.Maths.Color;

View File

@@ -4,10 +4,10 @@ using Content.Server.NodeContainer.Nodes;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Power.Nodes; using Content.Server.Power.Nodes;
using Content.Server.Power.NodeGroups; using Content.Server.Power.NodeGroups;
using Content.Server.Station.Components;
using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Components;
using Content.Shared.GameTicking.Components; using Content.Shared.GameTicking.Components;
using Content.Shared.Pinpointer; using Content.Shared.Pinpointer;
using Content.Shared.Station.Components;
using Content.Shared.Power; using Content.Shared.Power;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -2,7 +2,7 @@
using Content.Server.Atmos.EntitySystems; using Content.Server.Atmos.EntitySystems;
using Content.Server.Chat.Managers; using Content.Server.Chat.Managers;
using Content.Server.GameTicking; using Content.Server.GameTicking;
using Content.Server.Station.Components; using Content.Shared.Station.Components;
using Content.Server.Station.Systems; using Content.Server.Station.Systems;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.Maps; using Content.Shared.Maps;

View File

@@ -1,6 +1,6 @@
using Content.Server.Shuttles.Components; using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Events; using Content.Server.Shuttles.Events;
using Content.Server.Station.Components; using Content.Shared.Station.Components;
using Content.Shared.UserInterface; using Content.Shared.UserInterface;
namespace Content.Server.Shuttles.Systems; namespace Content.Server.Shuttles.Systems;

View File

@@ -7,6 +7,7 @@ using Content.Shared.CCVar;
using Content.Shared.Procedural; using Content.Shared.Procedural;
using Content.Shared.Salvage; using Content.Shared.Salvage;
using Content.Shared.Shuttles.Components; using Content.Shared.Shuttles.Components;
using Content.Shared.Station.Components;
using Robust.Shared.Collections; using Robust.Shared.Collections;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Random; using Robust.Shared.Random;

View File

@@ -5,6 +5,7 @@ using Content.Server.Station.Components;
using Content.Server.Station.Events; using Content.Server.Station.Events;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.Station; using Content.Shared.Station;
using Content.Shared.Station.Components;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Server.Player; using Robust.Server.Player;

View File

@@ -1,10 +1,9 @@
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Resist; using Content.Server.Resist;
using Content.Server.Station.Components;
using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Components;
using Content.Server.Storage.Components; using Content.Server.Storage.Components;
using Content.Server.Storage.EntitySystems; using Content.Server.Storage.EntitySystems;
using Content.Shared.Access.Components; using Content.Shared.Access.Components;
using Content.Shared.Station.Components;
using Content.Shared.GameTicking.Components; using Content.Shared.GameTicking.Components;
using Content.Shared.Coordinates; using Content.Shared.Coordinates;

View File

@@ -1,8 +1,8 @@
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Server.Station.Components;
using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Components;
using Content.Shared.GameTicking.Components; using Content.Shared.GameTicking.Components;
using Content.Shared.Station.Components;
using JetBrains.Annotations; using JetBrains.Annotations;
namespace Content.Server.StationEvents.Events; namespace Content.Server.StationEvents.Events;

View File

@@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using Content.Server.Silicons.Laws; using Content.Server.Silicons.Laws;
using Content.Server.Station.Components;
using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Components;
using Content.Shared.Administration.Logs; using Content.Shared.Administration.Logs;
using Content.Shared.Database; using Content.Shared.Database;
@@ -11,6 +10,7 @@ using Content.Shared.Random;
using Content.Shared.Random.Helpers; using Content.Shared.Random.Helpers;
using Content.Shared.Silicons.Laws; using Content.Shared.Silicons.Laws;
using Content.Shared.Silicons.Laws.Components; using Content.Shared.Silicons.Laws.Components;
using Content.Shared.Station.Components;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;

View File

@@ -1,10 +1,9 @@
using System.Threading; using System.Threading;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Power.Components; using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Server.Station.Components;
using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Components;
using Content.Shared.GameTicking.Components; using Content.Shared.GameTicking.Components;
using Content.Shared.Station.Components;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Player; using Robust.Shared.Player;

View File

@@ -1,14 +1,13 @@
using Content.Server.Atmos.Piping.Unary.Components; using Content.Server.Atmos.Piping.Unary.Components;
using Content.Server.Station.Components; using Content.Server.Fluids.EntitySystems;
using Content.Server.StationEvents.Components;
using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Reagent;
using Content.Shared.GameTicking.Components;
using Content.Shared.Station.Components;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Random; using Robust.Shared.Random;
using System.Linq; using System.Linq;
using Content.Server.Fluids.EntitySystems;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.StationEvents.Components;
using Content.Shared.GameTicking.Components;
namespace Content.Server.StationEvents.Events; namespace Content.Server.StationEvents.Events;

View File

@@ -1,7 +1,6 @@
using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Components;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Station.Components;
using Content.Shared.GameTicking.Components; using Content.Shared.GameTicking.Components;
using Content.Shared.Station.Components;
using Content.Shared.Storage; using Content.Shared.Storage;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Random; using Robust.Shared.Random;

View File

@@ -1,7 +1,6 @@
using System.Linq; using System.Linq;
using Content.Server.Explosion.EntitySystems; using Content.Server.Explosion.EntitySystems;
using Content.Server.Resist; using Content.Server.Resist;
using Content.Server.Station.Components;
using Content.Server.Storage.Components; using Content.Server.Storage.Components;
using Content.Shared.Access; using Content.Shared.Access;
using Content.Shared.Access.Components; using Content.Shared.Access.Components;
@@ -9,6 +8,7 @@ using Content.Shared.Coordinates;
using Content.Shared.DoAfter; using Content.Shared.DoAfter;
using Content.Shared.Lock; using Content.Shared.Lock;
using Content.Shared.Mind.Components; using Content.Shared.Mind.Components;
using Content.Shared.Station.Components;
using Content.Shared.Storage.Components; using Content.Shared.Storage.Components;
using Content.Shared.Storage.EntitySystems; using Content.Shared.Storage.EntitySystems;
using Content.Shared.Tools.Systems; using Content.Shared.Tools.Systems;

View File

@@ -1,11 +1,11 @@
using Content.Server.Station.Systems; using Robust.Shared.GameStates;
namespace Content.Server.Station.Components; namespace Content.Shared.Station.Components;
/// <summary> /// <summary>
/// Indicates that a grid is a member of the given station. /// Indicates that a grid is a member of the given station.
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(StationSystem))] [RegisterComponent, NetworkedComponent]
public sealed partial class StationMemberComponent : Component public sealed partial class StationMemberComponent : Component
{ {
/// <summary> /// <summary>