Fix errors
This commit is contained in:
@@ -1,24 +1,18 @@
|
||||
using Content.Server.Mind.Components;
|
||||
using Content.Server.Traitor;
|
||||
using Content.Server.Mind;
|
||||
using Content.Server.Roles;
|
||||
using Content.Shared.Store;
|
||||
|
||||
namespace Content.Server.Store.Conditions;
|
||||
|
||||
public sealed class BuyerBlockForAntagCondition : ListingCondition
|
||||
public sealed partial class BuyerBlockForAntagCondition : ListingCondition
|
||||
{
|
||||
public override bool Condition(ListingConditionArgs args)
|
||||
{
|
||||
var ent = args.EntityManager;
|
||||
|
||||
if (!ent.TryGetComponent<MindComponent>(args.Buyer, out var mind) || mind.Mind == null)
|
||||
var roleSystem = ent.System<RoleSystem>();
|
||||
var mindSystem = ent.System<MindSystem>();
|
||||
if (!mindSystem.TryGetMind(args.Buyer, out var mindId, out var mind))
|
||||
return false;
|
||||
|
||||
foreach (var role in mind.Mind.AllRoles)
|
||||
{
|
||||
if (role is TraitorRole traitorRole)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return !roleSystem.MindIsAntagonist(mindId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
using Content.Server.Mind.Components;
|
||||
using Content.Server.Mind;
|
||||
using Content.Server.Roles.Jobs;
|
||||
using Content.Shared.Store;
|
||||
|
||||
namespace Content.Server.Store.Conditions;
|
||||
|
||||
public sealed class BuyerBlockForMindProtected : ListingCondition
|
||||
public sealed partial class BuyerBlockForMindProtected : ListingCondition
|
||||
{
|
||||
public override bool Condition(ListingConditionArgs args)
|
||||
{
|
||||
var buyer = args.Buyer;
|
||||
var ent = args.EntityManager;
|
||||
|
||||
if (!ent.TryGetComponent<MindComponent>(buyer, out var mind) || mind.Mind == null)
|
||||
var roleSystem = ent.System<JobSystem>();
|
||||
var mindSystem = ent.System<MindSystem>();
|
||||
if (!mindSystem.TryGetMind(args.Buyer, out var mindId, out var mind))
|
||||
return false;
|
||||
|
||||
if (mind.Mind.CurrentJob?.CanBeAntag != true)
|
||||
if (mind.Session == null)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return !roleSystem.CanBeAntag(mind.Session);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using Content.Server.White.Sponsors;
|
||||
using Content.Shared.Store;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Store.Conditions;
|
||||
|
||||
public sealed class DonationTierLockCondition : ListingCondition
|
||||
public sealed partial class DonationTierLockCondition : ListingCondition
|
||||
{
|
||||
[DataField("tier", required: true)]
|
||||
public int Tier;
|
||||
|
||||
@@ -227,7 +227,7 @@ public sealed partial class StoreSystem
|
||||
UpdateUserInterface(buyer, uid, component);
|
||||
}
|
||||
|
||||
public void CloseUi(EntityUid user, StoreComponent component)
|
||||
public void CloseSessionUi(EntityUid user, StoreComponent component)
|
||||
{
|
||||
if (!TryComp<ActorComponent>(user, out var actor))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user