]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix `ResearchSystem.Client` `UpdateClientInterface` preconditions. (#25743)
authorexincore <me@exin.xyz>
Sat, 2 Mar 2024 12:44:24 +0000 (06:44 -0600)
committerGitHub <noreply@github.com>
Sat, 2 Mar 2024 12:44:24 +0000 (23:44 +1100)
* 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>
Content.Server/Research/Systems/ResearchSystem.Client.cs

index 135ef8fe8892e0c507b29e127dbc466faf96b4a2..6bd5300d8fe362585d340457b6df989c496148dd 100644 (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);
     }