mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-06-09 10:06:43 +02:00
@@ -45,6 +45,7 @@ namespace Content.Client.Construction
|
||||
WarmupRecipesCache();
|
||||
|
||||
UpdatesOutsidePrediction = true;
|
||||
SubscribeLocalEvent<PrototypesReloadedEventArgs>(OnPrototypeReload);
|
||||
SubscribeLocalEvent<LocalPlayerAttachedEvent>(HandlePlayerAttached);
|
||||
SubscribeNetworkEvent<AckStructureConstructionMessage>(HandleAckStructure);
|
||||
SubscribeNetworkEvent<ResponseConstructionGuide>(OnConstructionGuideReceived);
|
||||
@@ -76,8 +77,16 @@ namespace Content.Client.Construction
|
||||
return false;
|
||||
}
|
||||
|
||||
private void OnPrototypeReload(PrototypesReloadedEventArgs obj)
|
||||
{
|
||||
if (obj.WasModified<ConstructionPrototype>())
|
||||
WarmupRecipesCache();
|
||||
}
|
||||
|
||||
private void WarmupRecipesCache()
|
||||
{
|
||||
_recipesMetadataCache.Clear();
|
||||
|
||||
foreach (var constructionProto in PrototypeManager.EnumeratePrototypes<ConstructionPrototype>())
|
||||
{
|
||||
if (!PrototypeManager.Resolve(constructionProto.Graph, out var graphProto))
|
||||
|
||||
Reference in New Issue
Block a user