Skip to content

Commit

Permalink
Merge pull request #1295 from dvir001/2024-04-29-MailNo
Browse files Browse the repository at this point in the history
No mail for pirates
  • Loading branch information
GreaseMonk authored Apr 29, 2024
2 parents b2d2b8c + e1c6927 commit 07ba168
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Content.Server.Mail.Components
{
[RegisterComponent]
public sealed partial class MailDisabledComponent : Component
{}
}
7 changes: 7 additions & 0 deletions Content.Server/Nyanotrasen/Mail/MailSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public sealed class MailSystem : EntitySystem
[Dependency] private readonly ItemSystem _itemSystem = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly MetaDataSystem _metaDataSystem = default!;
[Dependency] private readonly IEntityManager _entManager = default!; // Frontier

private ISawmill _sawmill = default!;

Expand Down Expand Up @@ -579,6 +580,12 @@ public bool TryGetMailRecipientForReceiver(MailReceiverComponent receiver, [NotN
return false;
}

if (_entManager.TryGetComponent<MailDisabledComponent>(receiver.Owner, out var antag))
{
recipient = null;
return false;
}

var accessTags = access.Tags;

var mayReceivePriorityMail = !(_mindSystem.GetMind(receiver.Owner) == null);
Expand Down
3 changes: 3 additions & 0 deletions Resources/Prototypes/_NF/Roles/Jobs/Pirates/pirate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
accessGroups:
- GeneralAccess
special:
- !type:AddComponentSpecial
components:
- type: MailDisabled
- !type:AddImplantSpecial
implants: [ FreelanceTrackingImplant ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
accessGroups:
- GeneralAccess
special:
- !type:AddComponentSpecial
components:
- type: MailDisabled
- !type:AddImplantSpecial
implants: [ FreelanceTrackingImplant ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
- !type:OverallPlaytimeRequirement
time: 129600 # Frontier - 36 hours
startingGear: NFPirateFirstMateGear
canBeAntag: true
alwaysUseSpawner: true
canBeAntag: true
icon: "JobIconMercenary"
supervisors: job-supervisors-hire
setPreference: true
accessGroups:
- GeneralAccess
special:
- !type:AddComponentSpecial
components:
- type: MailDisabled
- !type:AddImplantSpecial
implants: [ FreelanceTrackingImplant ]

Expand Down

0 comments on commit 07ba168

Please sign in to comment.