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>
This commit is contained in:
exincore
2024-03-02 06:44:24 -06:00
committed by GitHub
parent a5200cc185
commit aaf5d0d302

View File

@@ -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);
}