Call reload protoypes on admin changes (#13160)
* Call reload protoypes on admin changes Fixes NPCs not working after engine change. * Also chems * other fixes
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
@@ -21,19 +17,20 @@ public sealed class GamePrototypeLoadManager : IGamePrototypeLoadManager
|
||||
|
||||
private void LoadGamePrototype(GamePrototypeLoadMessage message)
|
||||
{
|
||||
_prototypeManager.LoadString(message.PrototypeData, true);
|
||||
var changed = new Dictionary<Type, HashSet<string>>();
|
||||
_prototypeManager.LoadString(message.PrototypeData, true, changed);
|
||||
_prototypeManager.ResolveResults();
|
||||
_prototypeManager.ReloadPrototypes(changed);
|
||||
_localizationManager.ReloadLocalizations();
|
||||
GamePrototypeLoaded?.Invoke();
|
||||
Logger.InfoS("adminbus", "Loaded adminbus prototype data.");
|
||||
}
|
||||
|
||||
public void SendGamePrototype(string prototype)
|
||||
{
|
||||
var msg = _netManager.CreateNetMessage<GamePrototypeLoadMessage>();
|
||||
msg.PrototypeData = prototype;
|
||||
var msg = new GamePrototypeLoadMessage
|
||||
{
|
||||
PrototypeData = prototype
|
||||
};
|
||||
_netManager.ClientSendMessage(msg);
|
||||
}
|
||||
|
||||
public event Action? GamePrototypeLoaded;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user