Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

Commit

Permalink
[Resonance] Fix flags set (#2760)
Browse files Browse the repository at this point in the history
  • Loading branch information
ITeMbI4 authored Jul 28, 2024
1 parent e9af126 commit c6ec7f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Exiled.API/Extensions/EffectTypeExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ or EffectType.Corroding or EffectType.Decontaminating or EffectType.Hemorrhage o
/// <param name="effect">The <see cref="EffectType"/>.</param>
/// <returns>Whether or not the effect is a negative effect.</returns>
/// <seealso cref="IsHarmful(EffectType)"/>
public static bool IsNegative(this EffectType effect) => IsHarmful(effect) || GetEffectBase(effect)?.Classification is StatusEffectBase.EffectClassification.Negative;
public static bool IsNegative(this EffectType effect) => IsHarmful(effect) || GetEffectBase(effect)?.Classification == StatusEffectBase.EffectClassification.Negative;

/// <summary>
/// Returns whether or not the provided <paramref name="effect"/> is a positive effect.
Expand Down Expand Up @@ -212,13 +212,13 @@ public static EffectCategory GetCategories(this EffectType effect)
{
EffectCategory category = EffectCategory.None;
if (effect.IsPositive())
category.AddFlags(EffectCategory.Positive);
category = category.AddFlags(EffectCategory.Positive);
if (effect.IsNegative())
category.AddFlags(EffectCategory.Negative);
category = category.AddFlags(EffectCategory.Negative);
if (effect.IsMovement())
category.AddFlags(EffectCategory.Movement);
category = category.AddFlags(EffectCategory.Movement);
if (effect.IsHarmful())
category.AddFlags(EffectCategory.Harmful);
category = category.AddFlags(EffectCategory.Harmful);

return category;
}
Expand Down
2 changes: 1 addition & 1 deletion Exiled.API/Features/Items/Firearm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ internal Firearm(ItemType type)
{
FirearmStatusFlags firearmStatusFlags = FirearmStatusFlags.MagazineInserted;
if (Base.HasAdvantageFlag(AttachmentDescriptiveAdvantages.Flashlight))
firearmStatusFlags.AddFlags(FirearmStatusFlags.FlashlightEnabled);
firearmStatusFlags = firearmStatusFlags.AddFlags(FirearmStatusFlags.FlashlightEnabled);

Base.Status = new(MaxAmmo, firearmStatusFlags, Base.GetCurrentAttachmentsCode());
}
Expand Down
2 changes: 1 addition & 1 deletion Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2895,7 +2895,7 @@ public Item AddItem(FirearmType firearmType, IEnumerable<AttachmentIdentifier> i
FirearmStatusFlags flags = FirearmStatusFlags.MagazineInserted;

if (firearm.Attachments.Any(a => a.Name == AttachmentName.Flashlight))
flags.AddFlags(FirearmStatusFlags.FlashlightEnabled);
flags = flags.AddFlags(FirearmStatusFlags.FlashlightEnabled);

firearm.Base.Status = new FirearmStatus(firearm.MaxAmmo, flags, firearm.Base.GetCurrentAttachmentsCode());
}
Expand Down

0 comments on commit c6ec7f3

Please sign in to comment.