Fix ResearchSystem.Client UpdateClientInterface preconditions. (#25743)

* fix(research): Fix `ResearchSystem.Client` `UpdateClientInterface` preconditions.

Fixes a paradox where selecting a research server requires a research server to already be selected.
This would softlock the research client until it is reconstructed.

* style: Discards the discard operator

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>

---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
(cherry picked from commit aaf5d0d302)
This commit is contained in:
exincore
2024-03-07 01:17:24 +01:00
committed by Debug
parent 1ae04eb89e
commit 795bb78af9
@@ -82,12 +82,11 @@ public sealed partial class ResearchSystem
if (!Resolve(uid, ref component, false))
return;
if (!TryGetClientServer(uid, out _, out var serverComponent, component))
return;
TryGetClientServer(uid, out _, out var serverComponent, component);
var names = GetServerNames();
var state = new ResearchClientBoundInterfaceState(names.Length, names,
GetServerIds(), component.ConnectedToServer ? serverComponent.Id : -1);
GetServerIds(), serverComponent?.Id ?? -1);
_uiSystem.TrySetUiState(uid, ResearchClientUiKey.Key, state);
}