From f04d5f09cfd3a077f943631e070d9bf2ecfbac70 Mon Sep 17 00:00:00 2001 From: SolStar2 <44028047+ewokswagger@users.noreply.github.com> Date: Mon, 23 Dec 2024 16:25:15 -0500 Subject: [PATCH] Fix Precog results not cached on init --- .../DeltaV/Abilities/Psionics/PrecognitionPowerSystem.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Server/DeltaV/Abilities/Psionics/PrecognitionPowerSystem.cs b/Content.Server/DeltaV/Abilities/Psionics/PrecognitionPowerSystem.cs index 79a56066e31..5edf08e097c 100644 --- a/Content.Server/DeltaV/Abilities/Psionics/PrecognitionPowerSystem.cs +++ b/Content.Server/DeltaV/Abilities/Psionics/PrecognitionPowerSystem.cs @@ -45,6 +45,7 @@ public sealed class PrecognitionPowerSystem : EntitySystem public override void Initialize() { base.Initialize(); + CachePrecognitionResults(); SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnShutdown); @@ -161,12 +162,12 @@ private void OnDoAfter(EntityUid uid, PrecognitionPowerComponent component, Prec /// Gets the precognition result message corosponding to the passed event id. /// /// message string corosponding to the event id passed - 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;