Skip to content

Commit

Permalink
update rule and add log
Browse files Browse the repository at this point in the history
  • Loading branch information
deltanedas committed Dec 23, 2024
1 parent 76379ab commit 919e422
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private void OnDoAfter(EntityUid uid, PrecognitionPowerComponent component, Prec
var msg = Loc.GetString(locId);
_chat.ChatMessageToOne(ChatChannel.Server,
msg,
Loc.GetString("chat-manager-server-wrap-message", ("message", message)),
Loc.GetString("chat-manager-server-wrap-message", ("message", msg)),
uid,
false,
mindComponent.Session.Channel,
Expand Down
5 changes: 4 additions & 1 deletion Content.Server/StationEvents/Events/VentCrittersRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Pinpointer;
using Content.Server.StationEvents.Components;
using Content.Shared.EntityTable;
using Content.Shared.GameTicking.Components;
using Content.Shared.Station.Components;
using Content.Shared.Storage;
Expand All @@ -26,6 +27,7 @@ public sealed class VentCrittersRule : StationEventSystem<VentCrittersRuleCompon
*/

[Dependency] private readonly AntagSelectionSystem _antag = default!;
[Dependency] private readonly EntityTableSystem _entityTable = default!;
[Dependency] private readonly ISharedPlayerManager _player = default!;
[Dependency] private readonly NavMapSystem _navMap = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
Expand Down Expand Up @@ -62,9 +64,10 @@ protected override void Ended(EntityUid uid, VentCrittersRuleComponent comp, Gam
var min = comp.Min * players / comp.PlayerRatio;
var max = comp.Max * players / comp.PlayerRatio;
var count = Math.Max(RobustRandom.Next(min, max), 1);
Log.Info($"Spawning {count} critters for {ToPrettyString(uid):rule}");
for (int i = 0; i < count; i++)
{
foreach (var spawn in EntitySpawnCollection.GetSpawns(comp.Entries, RobustRandom))
foreach (var spawn in _entityTable.GetSpawns(comp.Table))
{
Spawn(spawn, coords);
}
Expand Down

0 comments on commit 919e422

Please sign in to comment.