Fix centcom cargo gifts (#24701)

This commit is contained in:
themias
2024-01-30 06:05:20 -05:00
committed by GitHub
parent 9526ba68ff
commit 3933490962
2 changed files with 36 additions and 25 deletions

View File

@@ -3,6 +3,7 @@ using Content.Server.Cargo.Components;
using Content.Server.Cargo.Systems;
using Content.Server.GameTicking;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Station.Components;
using Content.Server.StationEvents.Components;
using Robust.Shared.Prototypes;
@@ -39,7 +40,8 @@ public sealed class CargoGiftsRule : StationEventSystem<CargoGiftsRuleComponent>
component.TimeUntilNextGifts += 30f;
if (!TryGetRandomStation(out var station, HasComp<StationCargoOrderDatabaseComponent>))
if (!TryGetRandomStation(out var station, HasComp<StationCargoOrderDatabaseComponent>) ||
!TryComp<StationDataComponent>(station, out var stationData))
return;
if (!TryComp<StationCargoOrderDatabaseComponent>(station, out var cargoDb))
@@ -65,7 +67,8 @@ public sealed class CargoGiftsRule : StationEventSystem<CargoGiftsRuleComponent>
Loc.GetString(component.Sender),
Loc.GetString(component.Description),
Loc.GetString(component.Dest),
cargoDb
cargoDb,
stationData!
))
{
break;