mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* Resolve StationEvent warnings * fix misuses of ent after rename, paracusia flip * oh god more rules * comments, whitespace, unnecessary precision * comments, NotNull->IsNull oops * more consistent ent vs. ent.Owner, whitespace * Greytide: "with accress from... access groups"
26 lines
939 B
C#
26 lines
939 B
C#
using Content.Server.GameTicking.Rules.Components;
|
|
using Content.Shared.GameTicking.Components;
|
|
using Content.Shared.GameTicking.Rules;
|
|
using Content.Shared.Storage;
|
|
|
|
namespace Content.Server.GameTicking.Rules;
|
|
|
|
/// <summary>
|
|
/// A handler for rules adding one or more additional rules when a first is added.
|
|
/// </summary>
|
|
/// <seealso cref="SubGamemodesComponent"/>
|
|
public sealed partial class SubGamemodesSystem : GameRuleSystem<SubGamemodesComponent>
|
|
{
|
|
protected override void Added(Entity<SubGamemodesComponent, GameRuleComponent> ent, ref GameRuleAddedEvent args)
|
|
{
|
|
var picked = EntitySpawnCollection.GetSpawns(ent.Comp1.Rules, RobustRandom);
|
|
foreach (var id in picked)
|
|
{
|
|
if (GameTicker.IsIgnored(id))
|
|
continue;
|
|
|
|
Log.Info($"Starting gamerule {id} as a subgamemode of {ToPrettyString(ent.Owner):rule}");
|
|
GameTicker.AddGameRule(id);
|
|
}
|
|
}
|
|
}
|