diff --git a/Content.Server/White/MeatyOre/MeatyOreStoreSystem.cs b/Content.Server/White/MeatyOre/MeatyOreStoreSystem.cs index 920bbe3df8..5cfc7fbcee 100644 --- a/Content.Server/White/MeatyOre/MeatyOreStoreSystem.cs +++ b/Content.Server/White/MeatyOre/MeatyOreStoreSystem.cs @@ -61,6 +61,7 @@ public sealed class MeatyOreStoreSystem : EntitySystem private static readonly string MeatyOreCurrencyPrototype = "MeatyOreCoin"; private bool _meatyOrePanelEnabled; + private bool _antagGrantEnabled; private readonly Dictionary _meatyOreStores = new(); @@ -72,6 +73,7 @@ public sealed class MeatyOreStoreSystem : EntitySystem _configurationManager.OnValueChanged(WhiteCVars.MeatyOrePanelEnabled, OnPanelEnableChanged, true); _configurationManager.OnValueChanged(WhiteCVars.OnlyInOhio, s => _apiUrl = s, true); + _configurationManager.OnValueChanged(WhiteCVars.EnableGrantAntag, b => _antagGrantEnabled = b, true ); SubscribeLocalEvent(OnPostRoundCleanup); SubscribeNetworkEvent(OnShopRequested); @@ -81,6 +83,9 @@ public sealed class MeatyOreStoreSystem : EntitySystem private void MeatyOreVerbs(GetVerbsEvent ev) { + if(!_antagGrantEnabled) + return; + if (!EntityManager.TryGetComponent(ev.User, out var actorComponent)) return; @@ -209,6 +214,12 @@ public sealed class MeatyOreStoreSystem : EntitySystem return; } + if (!store.Balance.TryGetValue(MeatyOreCurrencyPrototype, out var currency)) + return; + + if(currency - 10 < 0) + return; + var fake = _roleSystem.MindIsAntagonist(targetMind.Mind.Value) || _jobSystem.CanBeAntag(mindComponent.Session); diff --git a/Content.Shared/White/WhiteCVars.cs b/Content.Shared/White/WhiteCVars.cs index e3315fc704..7b888cf8ce 100644 --- a/Content.Shared/White/WhiteCVars.cs +++ b/Content.Shared/White/WhiteCVars.cs @@ -335,4 +335,10 @@ public sealed class WhiteCVars public static readonly CVarDef SlipPowerModifier = CVarDef.Create("white.slip_power_modifier", 1.0f, CVar.REPLICATED); + + /* + * Antag grant + */ + public static readonly CVarDef EnableGrantAntag = + CVarDef.Create("white.antag_grant_enabled", true, CVar.SERVERONLY); }