Fix anomaly vessels not generating points (#14137)

This commit is contained in:
Nemanja
2023-02-15 23:16:20 -05:00
committed by GitHub
parent 6b381f7304
commit 9ed3127ed5
4 changed files with 18 additions and 15 deletions

View File

@@ -10,7 +10,7 @@ public sealed partial class ResearchSystem
{
private void InitializeClient()
{
SubscribeLocalEvent<ResearchClientComponent, ComponentStartup>(OnClientStartup);
SubscribeLocalEvent<ResearchClientComponent, MapInitEvent>(OnClientMapInit);
SubscribeLocalEvent<ResearchClientComponent, ComponentShutdown>(OnClientShutdown);
SubscribeLocalEvent<ResearchClientComponent, BoundUIOpenedEvent>(OnClientUIOpen);
SubscribeLocalEvent<ResearchClientComponent, ConsoleServerSyncMessage>(OnConsoleSync);
@@ -26,12 +26,11 @@ public sealed partial class ResearchSystem
private void OnClientSelected(EntityUid uid, ResearchClientComponent component, ResearchClientServerSelectedMessage args)
{
var server = GetServerById(args.ServerId);
if (server == null)
if (!TryGetServerById(args.ServerId, out var serveruid, out var serverComponent))
return;
UnregisterClient(uid, clientComponent: component);
RegisterClient(uid, server.Owner, component, server);
UnregisterClient(uid, component);
RegisterClient(uid, serveruid.Value, component, serverComponent);
}
private void OnClientDeselected(EntityUid uid, ResearchClientComponent component, ResearchClientServerDeselectedMessage args)
@@ -66,7 +65,7 @@ public sealed partial class ResearchSystem
UpdateClientInterface(uid, component);
}
private void OnClientStartup(EntityUid uid, ResearchClientComponent component, ComponentStartup args)
private void OnClientMapInit(EntityUid uid, ResearchClientComponent component, MapInitEvent args)
{
var allServers = EntityQuery<ResearchServerComponent>(true).ToArray();
if (allServers.Length > 0)