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 aaf5d0d30254d27d319b2b5f5874ebe787537f0a)
This commit is contained in:
exincore 2024-03-02 06:44:24 -06:00 committed by Debug
parent 1ae04eb89e
commit 795bb78af9
No known key found for this signature in database
GPG Key ID: 271270A74EF9C350
1 changed files with 2 additions and 3 deletions

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