Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precog fixes #2519

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public sealed class PrecognitionPowerSystem : EntitySystem
public override void Initialize()
{
base.Initialize();
CachePrecognitionResults();

SubscribeLocalEvent<PrecognitionPowerComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<PrecognitionPowerComponent, ComponentShutdown>(OnShutdown);
Expand Down Expand Up @@ -161,12 +162,12 @@ private void OnDoAfter(EntityUid uid, PrecognitionPowerComponent component, Prec
/// Gets the precognition result message corosponding to the passed event id.
/// </summary>
/// <returns>message string corosponding to the event id passed</returns>
private LocId GetResultMessage(EntProtoId eventId)
private LocId? GetResultMessage(EntProtoId eventId)
{
if (!Results.TryGetValue(eventId, out var result))
{
Log.Error($"Prototype {eventId} does not have an associated precognitionResult!");
return string.Empty;
return null;
}

return result.Message;
Expand Down
Loading