fix shipyard (#1458)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas 2024-07-03 15:34:06 +00:00 committed by GitHub
parent 2ab45b8713
commit 4ae20967a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -38,7 +38,7 @@ public sealed partial class ShipyardConsoleMenu : FancyWindow
// don't include ships that aren't allowed by whitelist, server won't accept them anyway
foreach (var vessel in proto.EnumeratePrototypes<VesselPrototype>())
{
if(whitelist.IsWhitelistPass(vessel.Whitelist, console))
if (whitelist.IsWhitelistPassOrNull(vessel.Whitelist, console))
_vessels.Add(vessel);
}
_vessels.Sort((x, y) => string.Compare(x.Name, y.Name, StringComparison.CurrentCultureIgnoreCase));

View File

@ -4,6 +4,7 @@ using Content.Server.Radio.EntitySystems;
using Content.Server.Station.Systems;
using Content.Shared.Shipyard;
using Content.Shared.Shipyard.Prototypes;
using Content.Shared.Whitelist;
using Robust.Server.GameObjects;
using Robust.Shared.Random;
using System.Diagnostics.CodeAnalysis;
@ -13,6 +14,7 @@ namespace Content.Server.Shipyard;
public sealed class ShipyardConsoleSystem : SharedShipyardConsoleSystem
{
[Dependency] private readonly CargoSystem _cargo = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly MetaDataSystem _meta = default!;
[Dependency] private readonly RadioSystem _radio = default!;
@ -32,6 +34,10 @@ public sealed class ShipyardConsoleSystem : SharedShipyardConsoleSystem
protected override void TryPurchase(Entity<ShipyardConsoleComponent> ent, EntityUid user, VesselPrototype vessel)
{
// client prevents asking for this so dont need feedback for validation
if (_whitelist.IsWhitelistFail(vessel.Whitelist, ent))
return;
if (GetBankAccount(ent) is not {} bank)
return;