diff --git a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs index 9fb9e47409..20f5b1a376 100644 --- a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs +++ b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs @@ -56,9 +56,6 @@ public static class MirrorExtensions private static readonly ReadOnlyDictionary ReadOnlyWriterExtensionsValue = new(WriterExtensionsValue); private static readonly ReadOnlyDictionary ReadOnlySyncVarDirtyBitsValue = new(SyncVarDirtyBitsValue); private static readonly ReadOnlyDictionary ReadOnlyRpcFullNamesValue = new(RpcFullNamesValue); - private static MethodInfo setDirtyBitsMethodInfoValue; - private static MethodInfo sendSpawnMessageMethodInfoValue; - private static string[] adminToyBaseSyncVarsValue; /// /// Gets corresponding to . @@ -153,17 +150,17 @@ public static ReadOnlyDictionary RpcFullNames /// /// Gets a 's . /// - public static MethodInfo SetDirtyBitsMethodInfo => setDirtyBitsMethodInfoValue ??= typeof(NetworkBehaviour).GetMethod(nameof(NetworkBehaviour.SetSyncVarDirtyBit)); + public static MethodInfo SetDirtyBitsMethodInfo => field ??= typeof(NetworkBehaviour).GetMethod(nameof(NetworkBehaviour.SetSyncVarDirtyBit)); /// /// Gets a NetworkServer.SendSpawnMessage's . /// - public static MethodInfo SendSpawnMessageMethodInfo => sendSpawnMessageMethodInfoValue ??= typeof(NetworkServer).GetMethod("SendSpawnMessage", BindingFlags.NonPublic | BindingFlags.Static); + public static MethodInfo SendSpawnMessageMethodInfo => field ??= typeof(NetworkServer).GetMethod("SendSpawnMessage", BindingFlags.NonPublic | BindingFlags.Static); /// /// Gets all sync var names. /// - public static string[] AdminToyBaseSyncVars => adminToyBaseSyncVarsValue ??= typeof(AdminToyBase).GetProperties().Where(property => property.Name.Contains("Network")).Select(property => property.Name).ToArray(); + public static string[] AdminToyBaseSyncVars => field ??= typeof(AdminToyBase).GetProperties().Where(property => property.Name.Contains("Network")).Select(property => property.Name).ToArray(); /// /// Plays a beep sound that only the target can hear. diff --git a/EXILED/Exiled.API/Features/Camera.cs b/EXILED/Exiled.API/Features/Camera.cs index fa17a77540..4eedc693dd 100644 --- a/EXILED/Exiled.API/Features/Camera.cs +++ b/EXILED/Exiled.API/Features/Camera.cs @@ -157,8 +157,6 @@ public class Camera : IWrapper, IWorldSpace ["SZ CAMERA TOY"] = CameraType.SzCameraToy, }; - private Room room; - /// /// Initializes a new instance of the class. /// @@ -220,7 +218,7 @@ internal Camera(Scp079Camera camera079) /// /// Gets the camera's . /// - public Room Room => room ??= Room.Get(Base.Room); + public Room Room => field ??= Room.Get(Base.Room); /// /// Gets the camera's . diff --git a/EXILED/Exiled.API/Features/Core/EActor.cs b/EXILED/Exiled.API/Features/Core/EActor.cs index f7f6beca77..b051974788 100644 --- a/EXILED/Exiled.API/Features/Core/EActor.cs +++ b/EXILED/Exiled.API/Features/Core/EActor.cs @@ -31,8 +31,6 @@ public abstract class EActor : EObject, IEntity, IWorldSpace private readonly HashSet componentsInChildren = HashSetPool.Pool.Get(); private CoroutineHandle serverTick; - private bool canEverTick; - private float fixedTickRate; /// /// Initializes a new instance of the class. @@ -42,10 +40,10 @@ protected EActor() { IsEditable = true; CanEverTick = true; - fixedTickRate = DefaultFixedTickRate; + FixedTickRate = DefaultFixedTickRate; PostInitialize(); - Timing.CallDelayed(fixedTickRate, () => OnBeginPlay()); - Timing.CallDelayed(fixedTickRate * 2, () => serverTick = Timing.RunCoroutine(ServerTick())); + Timing.CallDelayed(FixedTickRate, OnBeginPlay); + Timing.CallDelayed(FixedTickRate * 2, () => serverTick = Timing.RunCoroutine(ServerTick())); } /// @@ -99,15 +97,15 @@ public virtual Vector3 Scale /// public virtual bool CanEverTick { - get => canEverTick; + get; set { if (!IsEditable) return; - canEverTick = value; + field = value; - if (canEverTick) + if (field) { Timing.ResumeCoroutines(serverTick); return; @@ -122,13 +120,13 @@ public virtual bool CanEverTick /// public virtual float FixedTickRate { - get => fixedTickRate; + get; set { if (!IsEditable) return; - fixedTickRate = value; + field = value; } } diff --git a/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs b/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs index bce10ed688..ce193ec7a5 100644 --- a/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs +++ b/EXILED/Exiled.API/Features/Core/StateMachine/StateController.cs @@ -19,7 +19,6 @@ namespace Exiled.API.Features.Core.StateMachine public abstract class StateController : EActor { private readonly List states = new(); - private State currentState; /// /// Gets all handled states. @@ -31,14 +30,14 @@ public abstract class StateController : EActor /// public State CurrentState { - get => currentState; + get; set { - if (currentState.Id == value.Id) + if (field.Id == value.Id) return; - (PreviousState = currentState).OnExit(this); - (currentState = value).OnEnter(this); + (PreviousState = field).OnExit(this); + (field = value).OnEnter(this); OnStateChanged(); } @@ -75,7 +74,7 @@ public virtual void StateUpdate(State state) protected virtual void OnStateChanged() { EndStateMulticastDispatcher.InvokeAll(PreviousState); - BeginStateMulticastDispatcher.InvokeAll(currentState); + BeginStateMulticastDispatcher.InvokeAll(CurrentState); } } } \ No newline at end of file diff --git a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs index 248e89452b..6a9b8f4562 100644 --- a/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs +++ b/EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs @@ -28,9 +28,6 @@ namespace Exiled.API.Features.DamageHandlers /// public abstract class DamageHandlerBase { - private DamageType damageType; - private CassieAnnouncement cassieAnnouncement; - /// /// Initializes a new instance of the class. /// @@ -78,8 +75,8 @@ public enum Action : byte /// public virtual CassieAnnouncement CassieDeathAnnouncement { - get => cassieAnnouncement ?? Base.CassieDeathAnnouncement; - protected set => cassieAnnouncement = value; + get => field ?? Base.CassieDeathAnnouncement; + protected set; } /// @@ -94,11 +91,11 @@ public virtual DamageType Type { get { - if (damageType != DamageType.Unknown) - return damageType; + if (field != DamageType.Unknown) + return field; - damageType = GetDamageType(); - return damageType; + field = GetDamageType(); + return field; } protected set @@ -106,7 +103,7 @@ protected set if (!Enum.IsDefined(typeof(DamageType), value)) throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(DamageType)); - damageType = value; + field = value; } } diff --git a/EXILED/Exiled.API/Features/Generator.cs b/EXILED/Exiled.API/Features/Generator.cs index 125bdd347b..8f3d6f41be 100644 --- a/EXILED/Exiled.API/Features/Generator.cs +++ b/EXILED/Exiled.API/Features/Generator.cs @@ -27,7 +27,6 @@ public class Generator : IWrapper, IWorldSpace, IStructureSync /// A of on the map. /// internal static readonly Dictionary Scp079GeneratorToGenerator = new(new ComponentsEqualityComparer()); - private Room room; /// /// Initializes a new instance of the class. @@ -63,7 +62,7 @@ internal Generator(Scp079Generator scp079Generator) /// /// Gets the generator's . /// - public Room Room => room ??= Room.FindParentRoom(GameObject); + public Room Room => field ??= Room.FindParentRoom(GameObject); /// /// Gets or sets the generator' state. diff --git a/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs b/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs index cc9bff8d67..3c2a982ab7 100644 --- a/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs +++ b/EXILED/Exiled.API/Features/Hazards/AmnesticCloudHazard.cs @@ -15,8 +15,6 @@ namespace Exiled.API.Features.Hazards /// public class AmnesticCloudHazard : TemporaryHazard { - private static Scp939AmnesticCloudInstance amnesticCloudPrefab; - /// /// Initializes a new instance of the class. /// @@ -36,10 +34,10 @@ public static Scp939AmnesticCloudInstance AmnesticCloudPrefab { get { - if (amnesticCloudPrefab == null) - amnesticCloudPrefab = PrefabHelper.GetPrefab(PrefabType.AmnesticCloudHazard); + if (field == null) + field = PrefabHelper.GetPrefab(PrefabType.AmnesticCloudHazard); - return amnesticCloudPrefab; + return field; } } diff --git a/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs b/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs index 2e36627d8b..1660ba4dc9 100644 --- a/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs +++ b/EXILED/Exiled.API/Features/Hazards/TantrumHazard.cs @@ -18,8 +18,6 @@ namespace Exiled.API.Features.Hazards /// public class TantrumHazard : TemporaryHazard { - private static TantrumEnvironmentalHazard tantrumPrefab; - /// /// Initializes a new instance of the class. /// @@ -37,10 +35,10 @@ public static TantrumEnvironmentalHazard TantrumPrefab { get { - if (tantrumPrefab == null) - tantrumPrefab = PrefabHelper.GetPrefab(PrefabType.TantrumObj); + if (field == null) + field = PrefabHelper.GetPrefab(PrefabType.TantrumObj); - return tantrumPrefab; + return field; } } diff --git a/EXILED/Exiled.API/Features/Map.cs b/EXILED/Exiled.API/Features/Map.cs index c4feacd0cb..4e8b3547ed 100644 --- a/EXILED/Exiled.API/Features/Map.cs +++ b/EXILED/Exiled.API/Features/Map.cs @@ -46,10 +46,6 @@ public static class Map /// internal static List TeleportsValue = new(); - private static AmbientSoundPlayer ambientSoundPlayer; - - private static SqueakSpawner squeakSpawner; - /// /// Gets a value indicating whether decontamination has begun in the light containment zone. /// @@ -123,12 +119,12 @@ public static bool IsDecontaminationEnabled /// /// Gets the . /// - public static AmbientSoundPlayer AmbientSoundPlayer => ambientSoundPlayer ??= ReferenceHub._hostHub.GetComponent(); + public static AmbientSoundPlayer AmbientSoundPlayer => field ??= ReferenceHub._hostHub.GetComponent(); /// /// Gets the . /// - public static SqueakSpawner SqueakSpawner => squeakSpawner ??= Object.FindFirstObjectByType(); + public static SqueakSpawner SqueakSpawner => field ??= Object.FindFirstObjectByType(); /// /// Sends a staff message to all players online with permission. diff --git a/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs b/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs index 1b63763531..3de6897413 100644 --- a/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs +++ b/EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs @@ -27,9 +27,6 @@ namespace Exiled.API.Features.Pickups /// public class BodyArmorPickup : Pickup, IWrapper { - private int helmetEfficacy; - private int vestEfficacy; - /// /// Initializes a new instance of the class. /// @@ -79,20 +76,12 @@ internal BodyArmorPickup(ItemType type) /// /// Gets or sets how strong the helmet on the armor is. /// - public int HelmetEfficacy - { - get => helmetEfficacy; - set => helmetEfficacy = value; - } + public int HelmetEfficacy { get; set; } /// /// Gets or sets how strong the vest on the armor is. /// - public int VestEfficacy - { - get => vestEfficacy; - set => vestEfficacy = value; - } + public int VestEfficacy { get; set; } /// /// Gets or sets how much faster stamina will drain when wearing this armor. @@ -131,8 +120,8 @@ internal override void ReadItemInfo(Item item) base.ReadItemInfo(item); if (item is Armor armoritem) { - helmetEfficacy = armoritem.HelmetEfficacy; - vestEfficacy = armoritem.VestEfficacy; + HelmetEfficacy = armoritem.HelmetEfficacy; + VestEfficacy = armoritem.VestEfficacy; StaminaUseMultiplier = armoritem.StaminaUseMultiplier; StaminaRegenMultiplier = armoritem.StaminaRegenMultiplier; AmmoLimits = armoritem.AmmoLimits; @@ -146,8 +135,8 @@ protected override void InitializeProperties(ItemBase itemBase) base.InitializeProperties(itemBase); if (itemBase is BodyArmor armoritem) { - helmetEfficacy = armoritem.HelmetEfficacy; - vestEfficacy = armoritem.VestEfficacy; + HelmetEfficacy = armoritem.HelmetEfficacy; + VestEfficacy = armoritem.VestEfficacy; StaminaUseMultiplier = armoritem._staminaUseMultiplier; StaminaRegenMultiplier = armoritem.StaminaRegenMultiplier; AmmoLimits = armoritem.AmmoLimits.Select(limit => (ArmorAmmoLimit)limit); diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index bfac75fbe0..522a0a2113 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -95,10 +95,6 @@ public class Player : TypeCastObject, IEntity, IWorldSpace private readonly HashSet componentsInChildren = new(); - private ReferenceHub referenceHub; - - private Role role; - /// /// Initializes a new instance of the class. /// @@ -192,10 +188,10 @@ public Player(GameObject gameObject) /// public ReferenceHub ReferenceHub { - get => referenceHub; + get; private set { - referenceHub = value ?? throw new NullReferenceException("Player's ReferenceHub cannot be null!"); + field = value ?? throw new NullReferenceException("Player's ReferenceHub cannot be null!"); GameObject = value.gameObject; HintDisplay = value.hints; Inventory = value.inventory; @@ -278,7 +274,7 @@ public int Id /// /// Gets the player's user id. /// - public string UserId => referenceHub.authManager.UserId; + public string UserId => ReferenceHub.authManager.UserId; /// /// Gets the player's user id without the authentication. @@ -599,11 +595,11 @@ public PlayerPermissions RemoteAdminPermissions /// public Role Role { - get => role ??= Role.Create(RoleManager.CurrentRole); + get => field ??= Role.Create(RoleManager.CurrentRole); internal set { - PreviousRole = role?.Type ?? RoleTypeId.None; - role = value; + PreviousRole = field?.Type ?? RoleTypeId.None; + field = value; } } @@ -654,7 +650,7 @@ public ScpSpawnPreferences.SpawnPreferences ScpPreferences public bool IsJumping { get => Role is FpcRole fpc && fpc.FirstPersonController.FpcModule.Motor.JumpController.IsJumping; - set => _ = Role is FpcRole fpc ? fpc.FirstPersonController.FpcModule.Motor.JumpController.IsJumping = value : _ = value; + set => (Role as FpcRole)?.FirstPersonController.FpcModule.Motor.JumpController.IsJumping = value; } /// @@ -863,7 +859,7 @@ public bool IsGodModeEnabled public byte UnitId { get => Role.Base is PlayerRoles.HumanRole humanRole ? humanRole.UnitNameId : byte.MinValue; - set => _ = Role.Base is PlayerRoles.HumanRole humanRole ? humanRole.UnitNameId = value : _ = value; + set => (Role.Base as PlayerRoles.HumanRole)?.UnitNameId = value; } /// @@ -1074,7 +1070,7 @@ public string GroupName /// /// /// - public IEnumerable ActiveEffects => referenceHub.playerEffectsController.AllEffects.Where(effect => effect.Intensity > 0); + public IEnumerable ActiveEffects => ReferenceHub.playerEffectsController.AllEffects.Where(effect => effect.Intensity > 0); /// /// Gets or sets the player's group. @@ -1962,7 +1958,7 @@ public void Handcuff() { ReferenceHub.inventory.SetDisarmedStatus(null); - DisarmedPlayers.Entries.Add(new DisarmedPlayers.DisarmedEntry(referenceHub.networkIdentity.netId, 0U)); + DisarmedPlayers.Entries.Add(new DisarmedPlayers.DisarmedEntry(ReferenceHub.networkIdentity.netId, 0U)); new DisarmedPlayersListMessage(DisarmedPlayers.Entries).SendToAuthenticated(0); } @@ -2183,7 +2179,7 @@ public int RemoveItem(Func predicate, bool destroy = true) /// /// The message to be sent. /// The message color. - public void SendConsoleMessage(string message, string color) => referenceHub.gameConsoleTransmission.SendToClient(message, color); + public void SendConsoleMessage(string message, string color) => ReferenceHub.gameConsoleTransmission.SendToClient(message, color); /// /// Disconnects the player. @@ -2590,7 +2586,7 @@ public ushort GetAmmoLimit(AmmoType type, bool ignoreArmor = false) return ServerConfigSynchronizer.Singleton.AmmoLimitsSync.FirstOrDefault(x => x.AmmoType == itemType).Limit; } - return InventorySystem.Configs.InventoryLimits.GetAmmoLimit(type.GetItemType(), referenceHub); + return InventorySystem.Configs.InventoryLimits.GetAmmoLimit(type.GetItemType(), ReferenceHub); } /// @@ -2666,7 +2662,7 @@ public sbyte GetCategoryLimit(ItemCategory category, bool ignoreArmor = false) return ServerConfigSynchronizer.Singleton.CategoryLimits[index]; } - sbyte limit = InventorySystem.Configs.InventoryLimits.GetCategoryLimit(category, referenceHub); + sbyte limit = InventorySystem.Configs.InventoryLimits.GetCategoryLimit(category, ReferenceHub); return limit == -1 ? (sbyte)1 : limit; } diff --git a/EXILED/Exiled.API/Features/Respawn.cs b/EXILED/Exiled.API/Features/Respawn.cs index 0f34495520..fba56ca96d 100644 --- a/EXILED/Exiled.API/Features/Respawn.cs +++ b/EXILED/Exiled.API/Features/Respawn.cs @@ -25,9 +25,6 @@ namespace Exiled.API.Features /// public static class Respawn { - private static GameObject ntfHelicopterGameObject; - private static GameObject chaosCarGameObject; - /// /// Gets the of paused 's. /// @@ -45,10 +42,10 @@ public static GameObject NtfHelicopter { get { - if (ntfHelicopterGameObject == null) - ntfHelicopterGameObject = GameObject.Find("Chopper"); + if (field == null) + field = GameObject.Find("Chopper"); - return ntfHelicopterGameObject; + return field; } } @@ -59,10 +56,10 @@ public static GameObject ChaosVan { get { - if (chaosCarGameObject == null) - chaosCarGameObject = GameObject.Find("CIVanArrive"); + if (field == null) + field = GameObject.Find("CIVanArrive"); - return chaosCarGameObject; + return field; } } diff --git a/EXILED/Exiled.API/Features/Roles/FpcRole.cs b/EXILED/Exiled.API/Features/Roles/FpcRole.cs index 9a1156833e..cf0cdae5c1 100644 --- a/EXILED/Exiled.API/Features/Roles/FpcRole.cs +++ b/EXILED/Exiled.API/Features/Roles/FpcRole.cs @@ -27,8 +27,6 @@ namespace Exiled.API.Features.Roles /// public abstract class FpcRole : Role, IVoiceRole { - private bool isUsingStamina = true; - /// /// Initializes a new instance of the class. /// @@ -190,12 +188,12 @@ public bool MovementDetected /// public bool IsUsingStamina { - get => isUsingStamina; + get; set { if (!value) Owner.ResetStamina(); - isUsingStamina = value; + field = value; } } diff --git a/EXILED/Exiled.API/Features/Server.cs b/EXILED/Exiled.API/Features/Server.cs index 825cfb3566..0d5809912e 100644 --- a/EXILED/Exiled.API/Features/Server.cs +++ b/EXILED/Exiled.API/Features/Server.cs @@ -32,8 +32,6 @@ namespace Exiled.API.Features /// public static class Server { - private static MethodInfo sendSpawnMessage; - /// /// Gets a dictionary that pairs assemblies with their associated plugins. /// @@ -53,7 +51,7 @@ public static class Server /// /// Gets the cached . /// - public static MethodInfo SendSpawnMessage => sendSpawnMessage ??= typeof(NetworkServer).GetMethod("SendSpawnMessage", BindingFlags.NonPublic | BindingFlags.Static); + public static MethodInfo SendSpawnMessage => field ??= typeof(NetworkServer).GetMethod("SendSpawnMessage", BindingFlags.NonPublic | BindingFlags.Static); /// /// Gets or sets the name of the server. diff --git a/EXILED/Exiled.API/Features/Warhead.cs b/EXILED/Exiled.API/Features/Warhead.cs index f261577770..3f1e12c516 100644 --- a/EXILED/Exiled.API/Features/Warhead.cs +++ b/EXILED/Exiled.API/Features/Warhead.cs @@ -20,8 +20,6 @@ namespace Exiled.API.Features /// public static class Warhead { - private static AlphaWarheadOutsitePanel alphaWarheadOutsitePanel; - /// /// Gets the cached component. /// @@ -35,7 +33,7 @@ public static class Warhead /// /// Gets the cached component. /// - public static AlphaWarheadOutsitePanel OutsitePanel => alphaWarheadOutsitePanel != null ? alphaWarheadOutsitePanel : (alphaWarheadOutsitePanel = UnityEngine.Object.FindFirstObjectByType()); + public static AlphaWarheadOutsitePanel OutsitePanel => field != null ? field : (field = Object.FindFirstObjectByType()); /// /// Gets the of the warhead lever. diff --git a/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs b/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs index 646c34bb50..8f701628a3 100644 --- a/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs +++ b/EXILED/Exiled.CustomRoles/API/Features/Parsers/AggregateExpectationTypeResolver.cs @@ -52,7 +52,7 @@ public AggregateExpectationTypeResolver(INamingConvention namingConvention) } /// - public Type BaseType => typeof(CustomAbility); + public Type BaseType => field ??= typeof(CustomAbility); /// public bool TryResolve(ParsingEventBuffer buffer, out Type? suggestedType) diff --git a/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs index abd2f4877f..d5dbbef859 100644 --- a/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs @@ -20,12 +20,8 @@ namespace Exiled.Events.EventArgs.Cassie /// public class SendingCassieMessageEventArgs : IDeniableEvent { - private readonly CassieAnnouncement announcement; private readonly CassieTtsPayload payload; - private string customSubtitles; - private float glitchScale; - /// /// Initializes a new instance of the class. /// @@ -35,7 +31,7 @@ public class SendingCassieMessageEventArgs : IDeniableEvent /// public SendingCassieMessageEventArgs(CassieAnnouncement annc, bool isAllowed = true) { - announcement = annc; + Announcement = annc; payload = annc.Payload; Words = payload.Content; @@ -84,13 +80,13 @@ public SendingCassieMessageEventArgs(CassieAnnouncement annc, bool isAllowed = t /// public string CustomSubtitles { - get => customSubtitles; + get; set { - if (customSubtitles != value) + if (field != value) SubtitleSource = CassieTtsPayload.SubtitleMode.Custom; - customSubtitles = value; + field = value; } } @@ -104,13 +100,13 @@ public string CustomSubtitles /// public float GlitchScale { - get => glitchScale; + get; set { if (!MakeNoise && value is not 0) MakeNoise = true; - glitchScale = value; + field = value; } } @@ -157,7 +153,7 @@ public CassieAnnouncement Announcement newPayload = new CassieTtsPayload(Words, CustomSubtitles, MakeHold); } - return announcement switch + return field switch { CassieScpTerminationAnnouncement => @@ -169,6 +165,7 @@ public CassieAnnouncement Announcement _ => new CassieAnnouncement(newPayload, 0, GlitchScale / (API.Features.Warhead.IsDetonated ? 2F : 1F) * (MakeNoise ? 1F : 0F)), }; } + private set; } } } \ No newline at end of file diff --git a/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs index a0bba7e674..474995b3b8 100644 --- a/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs @@ -27,8 +27,6 @@ namespace Exiled.Events.EventArgs.Map /// public class ExplodingGrenadeEventArgs : IPlayerEvent, IDeniableEvent, IPickupEvent { - private ExplosionType explosionType; - /// /// Initializes a new instance of the class. /// @@ -125,8 +123,8 @@ public ExplodingGrenadeEventArgs(Player thrower, EffectGrenade grenade, HashSet< /// Explosion that are not from will return and can't be modified. public ExplosionType ExplosionType { - get => explosionType; - set => explosionType = Projectile is ExplosionGrenadeProjectile ? value : ExplosionType.Custom; + get; + set => field = Projectile is ExplosionGrenadeProjectile ? value : ExplosionType.Custom; } /// diff --git a/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs index 86d15bf8d8..5679b15f76 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/BanningEventArgs.cs @@ -17,8 +17,6 @@ namespace Exiled.Events.EventArgs.Player /// public class BanningEventArgs : KickingEventArgs { - private long duration; - /// /// Initializes a new instance of the class. /// @@ -40,16 +38,16 @@ public BanningEventArgs(Player target, Player issuer, ICommandSender commandSend /// public long Duration { - get => duration; + get; set { - if (duration == value) + if (field == value) return; if (Events.Instance.Config.ShouldLogBans) - LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed Ban duration: {duration} to {value} for ID: {Target.UserId}"); + LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed Ban duration: {field} to {value} for ID: {Target.UserId}"); - duration = value; + field = value; } } } diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs index 6978172b54..ee305c7ada 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingItemEventArgs.cs @@ -21,8 +21,6 @@ namespace Exiled.Events.EventArgs.Player /// public class ChangingItemEventArgs : IPlayerEvent, IDeniableEvent, IItemEvent { - private Item newItem; - /// /// Initializes a new instance of the class. /// @@ -35,7 +33,7 @@ public class ChangingItemEventArgs : IPlayerEvent, IDeniableEvent, IItemEvent public ChangingItemEventArgs(Player player, ItemBase newItem) { Player = player; - this.newItem = Item.Get(newItem); + Item = Item.Get(newItem); } /// @@ -43,13 +41,13 @@ public ChangingItemEventArgs(Player player, ItemBase newItem) /// public Item Item { - get => newItem; + get; set { if (value != null && !Player.Inventory.UserInventory.Items.TryGetValue(value.Serial, out _)) throw new InvalidOperationException("ev.NewItem cannot be set to an item they do not have."); - newItem = value; + field = value; } } diff --git a/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs index 898ab9fcd6..052fff48c6 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/ChangingRoleEventArgs.cs @@ -22,8 +22,6 @@ namespace Exiled.Events.EventArgs.Player /// public class ChangingRoleEventArgs : IPlayerEvent, IDeniableEvent { - private RoleTypeId newRole; - /// /// Initializes a new instance of the class. /// @@ -66,7 +64,7 @@ public ChangingRoleEventArgs(Player player, RoleTypeId newRole, RoleChangeReason /// public RoleTypeId NewRole { - get => newRole; + get; set { InventoryRoleInfo inventory = value.GetInventory(); @@ -80,7 +78,7 @@ public RoleTypeId NewRole foreach (KeyValuePair ammoPair in inventory.Ammo) Ammo.Add(ammoPair.Key, ammoPair.Value); - newRole = value; + field = value; } } diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs index 0b379c903a..999516aef2 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/DroppingAmmoEventArgs.cs @@ -19,8 +19,6 @@ namespace Exiled.Events.EventArgs.Player /// public class DroppingAmmoEventArgs : IPlayerEvent, IDeniableEvent { - private bool isAllowed = true; - /// /// Initializes a new instance of the class. /// @@ -66,18 +64,12 @@ public DroppingAmmoEventArgs(Player player, ItemType itemType, ushort amount, bo /// public bool IsAllowed { - get - { - if (Player.Role == RoleTypeId.Spectator) - isAllowed = true; - return isAllowed; - } - + get; set { if (Player.Role == RoleTypeId.Spectator) - value = true; - isAllowed = value; + return; + field = value; } } diff --git a/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs index cf15df90d3..16006c8164 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/DroppingItemEventArgs.cs @@ -21,8 +21,6 @@ namespace Exiled.Events.EventArgs.Player /// public class DroppingItemEventArgs : IItemEvent, IDeniableEvent { - private bool isAllowed = true; - /// /// Initializes a new instance of the class. /// @@ -44,6 +42,7 @@ public DroppingItemEventArgs(Player player, ItemBase item, bool isThrown, bool i Item = Item.Get(item); IsAllowed = isAllowed; IsThrown = isThrown; + IsAllowed = isAllowed; } /// @@ -56,18 +55,12 @@ public DroppingItemEventArgs(Player player, ItemBase item, bool isThrown, bool i /// public bool IsAllowed { - get - { - if (Player.Role == RoleTypeId.Spectator) - isAllowed = true; - return isAllowed; - } - + get; set { if (Player.Role == RoleTypeId.Spectator) - value = true; - isAllowed = value; + return; + field = value; } } diff --git a/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs index 2e94fd0e6d..7333b3b3f8 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs @@ -18,8 +18,6 @@ namespace Exiled.Events.EventArgs.Player /// public class EscapingEventArgs : IPlayerEvent, IDeniableEvent { - private EscapeScenario escapeScenario; - /// /// Initializes a new instance of the class. /// @@ -55,8 +53,8 @@ public EscapingEventArgs(ReferenceHub referenceHub, RoleTypeId newRole, EscapeSc /// public EscapeScenario EscapeScenario { - get => (escapeScenario is EscapeScenario.None && IsAllowed) ? EscapeScenario.CustomEscape : escapeScenario; - set => escapeScenario = value; + get => (field is EscapeScenario.None && IsAllowed) ? EscapeScenario.CustomEscape : field; + set; } /// diff --git a/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs index 086dd409bc..9555a12861 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/InteractingShootingTargetEventArgs.cs @@ -24,9 +24,6 @@ namespace Exiled.Events.EventArgs.Player /// public class InteractingShootingTargetEventArgs : IPlayerEvent, IDeniableEvent { - private int autoResetTime; - private int maxHp; - /// /// Initializes a new instance of the class. /// @@ -54,8 +51,8 @@ public InteractingShootingTargetEventArgs(Player player, ShootingTarget shooting ShootingTarget = ShootingTargetToy.Get(shootingTarget); TargetButton = targetButton; IsAllowed = isAllowed; - this.maxHp = maxHp; - this.autoResetTime = autoResetTime; + NewMaxHp = maxHp; + NewAutoResetTime = autoResetTime; } /// @@ -73,12 +70,12 @@ public InteractingShootingTargetEventArgs(Player player, ShootingTarget shooting /// public int NewMaxHp { - get => maxHp; + get; set { if (!ShootingTarget.IsSynced) throw new InvalidOperationException("Attempted to set MaxHp while target is in local mode. Set target's IsSynced to true before setting IsAllowed."); - maxHp = Mathf.Clamp(value, 1, 256); + field = Mathf.Clamp(value, 1, 256); } } @@ -87,12 +84,12 @@ public int NewMaxHp /// public int NewAutoResetTime { - get => autoResetTime; + get; set { if (!ShootingTarget.IsSynced) throw new InvalidOperationException("Attempted to set AutoResetTime while target is in local mode. Set target's IsSynced to true before setting IsAllowed."); - autoResetTime = Mathf.Clamp(value, 0, 10); + field = Mathf.Clamp(value, 0, 10); } } diff --git a/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs index cfa2864b85..3fc6c1221d 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/KickingEventArgs.cs @@ -19,9 +19,6 @@ namespace Exiled.Events.EventArgs.Player public class KickingEventArgs : IPlayerEvent, IDeniableEvent { private readonly string startkickmessage; - private bool isAllowed; - private Player issuer; - private Player target; /// /// Initializes a new instance of the class. @@ -59,16 +56,16 @@ public KickingEventArgs(Player target, Player issuer, ICommandSender commandSend /// public Player Target { - get => target; + get; set { - if (value is null || target == value) + if (value is null || field == value) return; - if (Events.Instance.Config.ShouldLogBans && target is not null) - LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed the banned player from user {target.Nickname} ({target.UserId}) to {value.Nickname} ({value.UserId})"); + if (Events.Instance.Config.ShouldLogBans && field is not null) + LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed the banned player from user {field.Nickname} ({field.UserId}) to {value.Nickname} ({value.UserId})"); - target = value; + field = value; } } @@ -87,16 +84,16 @@ public Player Target /// public bool IsAllowed { - get => isAllowed; + get; set { - if (isAllowed == value) + if (field == value) return; if (Events.Instance.Config.ShouldLogBans) LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" {(value ? "allowed" : "denied")} banning user with ID: {Target.UserId}"); - isAllowed = value; + field = value; } } @@ -105,16 +102,16 @@ public bool IsAllowed /// public Player Player { - get => issuer; + get; set { - if (value is null || issuer == value) + if (value is null || field == value) return; - if (Events.Instance.Config.ShouldLogBans && issuer is not null) - LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed the ban issuer from user {issuer.Nickname} ({issuer.UserId}) to {value.Nickname} ({value.UserId})"); + if (Events.Instance.Config.ShouldLogBans && field is not null) + LogBanChange(Assembly.GetCallingAssembly().GetName().Name, $" changed the ban issuer from user {field.Nickname} ({field.UserId}) to {value.Nickname} ({value.UserId})"); - issuer = value; + field = value; } } diff --git a/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs index 419a185713..84e5e8735a 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/LeftEventArgs.cs @@ -8,19 +8,22 @@ namespace Exiled.Events.EventArgs.Player { using API.Features; + using Exiled.Events.EventArgs.Interfaces; /// /// Contains all information after a disconnects from the server. /// - public class LeftEventArgs : JoinedEventArgs + public class LeftEventArgs : IPlayerEvent { /// /// Initializes a new instance of the class. /// /// The player who left the server. - public LeftEventArgs(Player player) - : base(player) - { - } + public LeftEventArgs(Player player) => Player = player; + + /// + /// Gets the left player. + /// + public Player Player { get; } } } \ No newline at end of file diff --git a/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs index ebb22cf345..cb949391ca 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/ReservedSlotsCheckEventArgs.cs @@ -15,8 +15,6 @@ namespace Exiled.Events.EventArgs.Player /// public class ReservedSlotsCheckEventArgs : IExiledEvent, IDeniableEvent { - private ReservedSlotEventResult reservedSlotEventResult = ReservedSlotEventResult.UseBaseGameSystem; - /// /// Initializes a new instance of the class. /// @@ -31,6 +29,7 @@ public ReservedSlotsCheckEventArgs(bool hasReservedSlot, string userId) UserId = userId; HasReservedSlot = hasReservedSlot; IsAllowed = hasReservedSlot; + Result = ReservedSlotEventResult.UseBaseGameSystem; } /// @@ -53,7 +52,7 @@ public ReservedSlotsCheckEventArgs(bool hasReservedSlot, string userId) /// public ReservedSlotEventResult Result { - get => reservedSlotEventResult; + get; set { switch (value) @@ -71,7 +70,7 @@ public ReservedSlotEventResult Result return; } - reservedSlotEventResult = value; + field = value; } } } diff --git a/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs index eb3251599a..599ac864bf 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/RevokingMuteEventArgs.cs @@ -8,11 +8,12 @@ namespace Exiled.Events.EventArgs.Player { using API.Features; + using Exiled.Events.EventArgs.Interfaces; /// /// Contains all information before unmuting a player. /// - public class RevokingMuteEventArgs : IssuingMuteEventArgs + public class RevokingMuteEventArgs : IPlayerEvent, IDeniableEvent { /// /// Initializes a new instance of the class. @@ -27,8 +28,25 @@ public class RevokingMuteEventArgs : IssuingMuteEventArgs /// Indicates whether the player can be unmuted. /// public RevokingMuteEventArgs(Player player, bool isIntercom, bool isAllowed = true) - : base(player, isIntercom, isAllowed) { + Player = player; + IsIntercom = isIntercom; + IsAllowed = isAllowed; } + + /// + /// Gets the player who's being revoking the mute. + /// + public Player Player { get; } + + /// + /// Gets or sets a value indicating whether the player is being revoking intercom muted. + /// + public bool IsIntercom { get; set; } + + /// + /// Gets or sets a value indicating whether the player can be revoked muted. + /// + public bool IsAllowed { get; set; } } } \ No newline at end of file diff --git a/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs index b7af91e658..4874f9de7b 100644 --- a/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Scp914/ChangingKnobSettingEventArgs.cs @@ -18,8 +18,6 @@ namespace Exiled.Events.EventArgs.Scp914 /// public class ChangingKnobSettingEventArgs : IPlayerEvent, IDeniableEvent { - private Scp914KnobSetting knobSetting; - /// /// Initializes a new instance of the class. /// @@ -44,8 +42,8 @@ public ChangingKnobSettingEventArgs(Player player, Scp914KnobSetting knobSetting /// public Scp914KnobSetting KnobSetting { - get => knobSetting; - set => knobSetting = value > Scp914KnobSetting.VeryFine ? Scp914KnobSetting.Coarse : value; + get; + set => field = value > Scp914KnobSetting.VeryFine ? Scp914KnobSetting.Coarse : value; } /// diff --git a/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs index df999d90dd..6e017b2816 100644 --- a/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs @@ -24,8 +24,6 @@ namespace Exiled.Events.EventArgs.Server /// public class RespawningTeamEventArgs : IDeniableEvent { - private int maximumRespawnAmount; - /// /// Initializes a new instance of the class. /// @@ -69,16 +67,16 @@ public RespawningTeamEventArgs(List players, int maxRespawn, SpawnableWa /// public int MaximumRespawnAmount { - get => maximumRespawnAmount; + get; set { - if (value < maximumRespawnAmount) + if (value < field) { if (Players.Count > value) Players.RemoveRange(value, Players.Count - value); } - maximumRespawnAmount = value; + field = value; } } diff --git a/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs index 6f006c5299..214c8f8c2b 100644 --- a/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Warhead/StartingEventArgs.cs @@ -8,11 +8,12 @@ namespace Exiled.Events.EventArgs.Warhead { using Exiled.API.Features; + using Exiled.Events.EventArgs.Interfaces; /// /// Contains all information before starting the warhead. /// - public class StartingEventArgs : StoppingEventArgs + public class StartingEventArgs : IPlayerEvent, IDeniableEvent { /// /// Initializes a new instance of the class. @@ -21,14 +22,25 @@ public class StartingEventArgs : StoppingEventArgs /// Indicating whether the nuke was set off automatically. /// Indicating whether the event can be executed. public StartingEventArgs(Player player, bool isAuto, bool isAllowed = true) - : base(player, isAllowed) { IsAuto = isAuto; + Player = player ?? Server.Host; + IsAllowed = isAllowed; } /// /// Gets or sets a value indicating whether the nuke was set off automatically. /// public bool IsAuto { get; set; } + + /// + /// Gets or sets a value indicating whether the warhead can be started. + /// + public bool IsAllowed { get; set; } + + /// + /// Gets the player who's going to start the warhead. + /// + public Player Player { get; } } } \ No newline at end of file diff --git a/EXILED/Exiled.Events/Events.cs b/EXILED/Exiled.Events/Events.cs index c941abd7ca..f01919aff5 100644 --- a/EXILED/Exiled.Events/Events.cs +++ b/EXILED/Exiled.Events/Events.cs @@ -30,12 +30,10 @@ namespace Exiled.Events /// public sealed class Events : Plugin { - private static Events instance; - /// /// Gets the plugin instance. /// - public static Events Instance => instance; + public static Events Instance { get; private set; } /// public override PluginPriority Priority { get; } = PluginPriority.First; @@ -48,7 +46,7 @@ public sealed class Events : Plugin /// public override void OnEnabled() { - instance = this; + Instance = this; base.OnEnabled(); Stopwatch watch = Stopwatch.StartNew(); diff --git a/EXILED/Exiled.Events/Patches/Generic/AirlockListAdd.cs b/EXILED/Exiled.Events/Patches/Generic/AirlockListAdd.cs index d8cab19b53..6da34a65eb 100644 --- a/EXILED/Exiled.Events/Patches/Generic/AirlockListAdd.cs +++ b/EXILED/Exiled.Events/Patches/Generic/AirlockListAdd.cs @@ -21,7 +21,7 @@ internal class AirlockListAdd { private static void Postfix(AirlockController __instance) { - _ = new API.Features.Doors.AirlockController(__instance); + new API.Features.Doors.AirlockController(__instance); } } diff --git a/EXILED/Exiled.Events/Patches/Generic/CoffeeListAdd.cs b/EXILED/Exiled.Events/Patches/Generic/CoffeeListAdd.cs index 1761e27416..d7eb560618 100644 --- a/EXILED/Exiled.Events/Patches/Generic/CoffeeListAdd.cs +++ b/EXILED/Exiled.Events/Patches/Generic/CoffeeListAdd.cs @@ -19,7 +19,7 @@ internal class CoffeeListAdd { private static void Postfix(global::Coffee __instance) { - _ = new Coffee(__instance); + new Coffee(__instance); } } } \ No newline at end of file diff --git a/EXILED/Exiled.Events/Patches/Generic/HazardList.cs b/EXILED/Exiled.Events/Patches/Generic/HazardList.cs index 34aacf25d1..db16697730 100644 --- a/EXILED/Exiled.Events/Patches/Generic/HazardList.cs +++ b/EXILED/Exiled.Events/Patches/Generic/HazardList.cs @@ -21,7 +21,7 @@ internal class HazardList { [HarmonyPatch(typeof(EnvironmentalHazard), nameof(EnvironmentalHazard.Start))] [HarmonyPostfix] - private static void Adding(EnvironmentalHazard __instance) => _ = Hazard.Get(__instance); + private static void Adding(EnvironmentalHazard __instance) => Hazard.Get(__instance); [HarmonyPatch(typeof(EnvironmentalHazard), nameof(EnvironmentalHazard.OnDestroy))] [HarmonyPostfix] diff --git a/EXILED/Exiled.Events/Patches/Generic/LiftList.cs b/EXILED/Exiled.Events/Patches/Generic/LiftList.cs index d4b212dcd5..d088dbe3ab 100644 --- a/EXILED/Exiled.Events/Patches/Generic/LiftList.cs +++ b/EXILED/Exiled.Events/Patches/Generic/LiftList.cs @@ -21,7 +21,7 @@ internal class LiftList { [HarmonyPatch(typeof(ElevatorChamber), nameof(ElevatorChamber.Start))] [HarmonyPostfix] - private static void Adding(ElevatorChamber __instance) => _ = new Lift(__instance); + private static void Adding(ElevatorChamber __instance) => new Lift(__instance); [HarmonyPatch(typeof(ElevatorChamber), nameof(ElevatorChamber.OnDestroy))] [HarmonyPostfix]