mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-06-09 15:06:34 +02:00
d611cf3219
* GRAAAAAAAAAAAAAAAH * cleanup * two more instances * safsaffsa * fix foolboxes? * cleanup game preset * API --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
22 lines
733 B
C#
22 lines
733 B
C#
using Content.Server.GameTicking.Rules.Components;
|
|
using Content.Shared.GameTicking.Components;
|
|
using Content.Shared.Storage;
|
|
|
|
namespace Content.Server.GameTicking.Rules;
|
|
|
|
public sealed class SubGamemodesSystem : GameRuleSystem<SubGamemodesComponent>
|
|
{
|
|
protected override void Added(EntityUid uid, SubGamemodesComponent comp, GameRuleComponent rule, GameRuleAddedEvent args)
|
|
{
|
|
var picked = EntitySpawnCollection.GetSpawns(comp.Rules, RobustRandom);
|
|
foreach (var id in picked)
|
|
{
|
|
if (GameTicker.IsIgnored(id))
|
|
continue;
|
|
|
|
Log.Info($"Starting gamerule {id} as a subgamemode of {ToPrettyString(uid):rule}");
|
|
GameTicker.AddGameRule(id);
|
|
}
|
|
}
|
|
}
|