Skip to content

Commit

Permalink
fix IsMelee validator to use attackMode source object
Browse files Browse the repository at this point in the history
  • Loading branch information
ThyWoof committed Jul 9, 2024
1 parent d111627 commit 2b299ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SolastaUnfinishedBusiness/Validators/ValidatorsWeapon.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Linq;
using System.Runtime.CompilerServices;
using JetBrains.Annotations;
using SolastaUnfinishedBusiness.Api.GameExtensions;
using SolastaUnfinishedBusiness.Behaviors.Specific;
using static RuleDefinitions;
using static SolastaUnfinishedBusiness.Api.DatabaseHelper.ArmorTypeDefinitions;
Expand Down Expand Up @@ -90,7 +91,7 @@ internal static bool IsMelee(
[UsedImplicitly] RulesetCharacter rulesetCharacter)
{
// don't use IsMelee(attackMode) in here as these are used before an attack initiates
return IsMelee(rulesetItem);
return IsMelee(attackMode?.SourceObject as RulesetItem ?? rulesetItem ?? rulesetCharacter?.GetMainWeapon());
}
#pragma warning restore IDE0060

Expand Down

0 comments on commit 2b299ff

Please sign in to comment.