StationEvent Toolshed Command fixes. (#32200)
* toolshed makes me want to take a long walk off a short pier. * fuck it everything is in seconds. * catch rounding error * reviews * lsprobtheoretical to mins * Git please. * Git Please. * GIT PLEASE. * unchange file * take2 * empty line? * new new lines? * idk 1000 commits I guess * spacius maximus
This commit is contained in:
@@ -55,7 +55,10 @@ public sealed class EventManagerSystem : EntitySystem
|
||||
/// </summary>
|
||||
public void RunRandomEvent(EntityTableSelector limitedEventsTable)
|
||||
{
|
||||
if (!TryBuildLimitedEvents(limitedEventsTable, out var limitedEvents))
|
||||
var availableEvents = AvailableEvents(); // handles the player counts and individual event restrictions.
|
||||
// Putting this here only makes any sense in the context of the toolshed commands in BasicStationEventScheduler. Kill me.
|
||||
|
||||
if (!TryBuildLimitedEvents(limitedEventsTable, availableEvents, out var limitedEvents))
|
||||
{
|
||||
Log.Warning("Provided event table could not build dict!");
|
||||
return;
|
||||
@@ -80,12 +83,14 @@ public sealed class EventManagerSystem : EntitySystem
|
||||
/// <summary>
|
||||
/// Returns true if the provided EntityTableSelector gives at least one prototype with a StationEvent comp.
|
||||
/// </summary>
|
||||
public bool TryBuildLimitedEvents(EntityTableSelector limitedEventsTable, out Dictionary<EntityPrototype, StationEventComponent> limitedEvents)
|
||||
public bool TryBuildLimitedEvents(
|
||||
EntityTableSelector limitedEventsTable,
|
||||
Dictionary<EntityPrototype, StationEventComponent> availableEvents,
|
||||
out Dictionary<EntityPrototype, StationEventComponent> limitedEvents
|
||||
)
|
||||
{
|
||||
limitedEvents = new Dictionary<EntityPrototype, StationEventComponent>();
|
||||
|
||||
var availableEvents = AvailableEvents(); // handles the player counts and individual event restrictions
|
||||
|
||||
if (availableEvents.Count == 0)
|
||||
{
|
||||
Log.Warning("No events were available to run!");
|
||||
|
||||
Reference in New Issue
Block a user