Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Commit

Permalink
Fix ResearchSystem.Client UpdateClientInterface preconditions. (s…
Browse files Browse the repository at this point in the history
…pace-wizards#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 <[email protected]>

---------

Co-authored-by: Nemanja <[email protected]>
  • Loading branch information
exincore and EmoGarbage404 authored Mar 2, 2024
1 parent a5200cc commit aaf5d0d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Content.Server/Research/Systems/ResearchSystem.Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ private void UpdateClientInterface(EntityUid uid, ResearchClientComponent? compo
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);
}
Expand Down

0 comments on commit aaf5d0d

Please sign in to comment.