Add chatty lathes (#34959)
This commit is contained in:
committed by
GitHub
parent
be5bbd4dc3
commit
5d38ae56de
@@ -54,7 +54,7 @@ public sealed partial class TechnologyDatabaseComponent : Component
|
||||
/// server to all of it's clients.
|
||||
/// </remarks>
|
||||
[ByRefEvent]
|
||||
public readonly record struct TechnologyDatabaseModifiedEvent;
|
||||
public readonly record struct TechnologyDatabaseModifiedEvent(List<string>? NewlyUnlockedRecipes);
|
||||
|
||||
/// <summary>
|
||||
/// Event raised on a database after being synchronized
|
||||
|
||||
@@ -7,6 +7,7 @@ using Content.Shared.Research.Prototypes;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Prototypes;
|
||||
using System.Linq;
|
||||
|
||||
namespace Content.Shared.Research.Systems;
|
||||
|
||||
@@ -64,7 +65,7 @@ public sealed class BlueprintSystem : EntitySystem
|
||||
|
||||
_container.Insert(blueprint.Owner, _container.GetContainer(ent, ent.Comp.ContainerId));
|
||||
|
||||
var ev = new TechnologyDatabaseModifiedEvent();
|
||||
var ev = new TechnologyDatabaseModifiedEvent(blueprint.Comp.ProvidedRecipes.Select(it => it.Id).ToList());
|
||||
RaiseLocalEvent(ent, ref ev);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ public abstract class SharedResearchSystem : EntitySystem
|
||||
component.UnlockedRecipes.Add(recipe);
|
||||
Dirty(uid, component);
|
||||
|
||||
var ev = new TechnologyDatabaseModifiedEvent();
|
||||
var ev = new TechnologyDatabaseModifiedEvent(new List<string> { recipe });
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user