Фикс метеоритов в тюрьме

This commit is contained in:
VigersRay 2024-07-12 15:59:48 +03:00
parent a7a02e82a9
commit 78980349cd
4 changed files with 25 additions and 1 deletions

View file

@ -1,4 +1,5 @@
using System.Numerics;
using Content.Server._Sunrise.Station;
using Content.Server.Chat.Systems;
using Content.Server.GameTicking.Rules;
using Content.Server.Station.Components;
@ -36,8 +37,17 @@ public sealed class MeteorSwarmSystem : GameRuleSystem<MeteorSwarmComponent>
component.NextWaveTime += TimeSpan.FromSeconds(component.WaveCooldown.Next(RobustRandom));
var stations = _station.GetStations();
if (_station.GetStations().Count == 0)
var validStations = new List<EntityUid>();
foreach (var entityUid in stations)
{
if (HasComp<StationMeteorSwarmTargetComponent>(entityUid))
validStations.Add(entityUid);
}
if (validStations.Count == 0)
return;
var station = RobustRandom.Pick(_station.GetStations());

View file

@ -0,0 +1,7 @@
namespace Content.Server._Sunrise.Station;
[RegisterComponent]
public sealed partial class StationMeteorSwarmTargetComponent : Component
{
}

View file

@ -33,6 +33,7 @@
- BaseStationGammaArmory
- BaseStationAntagsTargets
- BaseStationCryoTeleport
- BaseStationMeteorSwarmTarget
# Sunrise-End
noSpawn: true
components:

View file

@ -116,3 +116,9 @@
abstract: true
components:
- type: StationCryoTeleport
- type: entity
id: BaseStationMeteorSwarmTarget
abstract: true
components:
- type: StationMeteorSwarmTargetComponent