Fix anomaly vessels not generating points (#14137)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user