Fix anomaly vessels not generating points (#14137)

This commit is contained in:
Nemanja
2023-02-15 23:16:20 -05:00
committed by GitHub
parent 6b381f7304
commit 9ed3127ed5
4 changed files with 18 additions and 15 deletions

View File

@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared.Research.Components;
using Content.Shared.Research.Systems;
@@ -28,16 +29,22 @@ namespace Content.Server.Research.Systems
/// Gets a server based on it's unique numeric id.
/// </summary>
/// <param name="id"></param>
/// <param name="serverUid"></param>
/// <param name="serverComponent"></param>
/// <returns></returns>
public ResearchServerComponent? GetServerById(int id)
public bool TryGetServerById(int id, [NotNullWhen(true)] out EntityUid? serverUid, [NotNullWhen(true)] out ResearchServerComponent? serverComponent)
{
serverUid = null;
serverComponent = null;
foreach (var server in EntityQuery<ResearchServerComponent>())
{
if (server.Id == id)
return server;
if (server.Id != id)
continue;
serverUid = server.Owner;
serverComponent = server;
return true;
}
return null;
return false;
}
/// <summary>