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"
22 lines
794 B
C#
22 lines
794 B
C#
using Content.Server.StationEvents.Components;
|
|
using Content.Shared.GameTicking.Components;
|
|
|
|
namespace Content.Server.StationEvents.Events;
|
|
|
|
/// <summary>
|
|
/// Handler for events that spawn a given entity at a random tile on the affected station.
|
|
/// </summary>
|
|
/// <seealso cref="RandomSpawnRuleComponent"/>
|
|
public sealed partial class RandomSpawnRule : StationEventSystem<RandomSpawnRuleComponent>
|
|
{
|
|
protected override void Started(Entity<RandomSpawnRuleComponent, GameRuleComponent> ent, ref GameRuleStartedEvent args)
|
|
{
|
|
base.Started(ent, ref args);
|
|
|
|
if (Station.TryFindRandomTile(out _, out _, out _, out var coords))
|
|
{
|
|
Sawmill.Info($"Spawning {ent.Comp1.Prototype} at {coords}");
|
|
Spawn(ent.Comp1.Prototype, coords);
|
|
}
|
|
}
|
|
}
|