Skip to content

Commit 2abf4de

Browse files
committed
Changed ability counts to NUM_ABILITIES
1 parent f91949a commit 2abf4de

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Patches/CardTriggerHandler_Abilities_SpecialAbilities.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
using HarmonyLib;
55
using UnityEngine;
66

7+
#pragma warning disable Harmony003
8+
79
namespace API.Patches
810
{
911
[HarmonyPatch(typeof(CardTriggerHandler), "AddAbility", typeof(Ability))]
1012
public class CardTriggerHandler_AddAbility_Ability
1113
{
1214
public static bool Prefix(Ability ability, CardTriggerHandler __instance)
1315
{
14-
if ((int)ability < 99)
16+
if ((int) ability < (int) Ability.NUM_ABILITIES)
1517
{
1618
return true;
1719
}
@@ -50,8 +52,8 @@ public class CardTriggerHandler_AddAbility_SpecialTriggeredAbility
5052
public static bool Prefix(SpecialTriggeredAbility ability, CardTriggerHandler __instance)
5153
{
5254
Plugin.Log.LogDebug($"Attempting to add spec ability to card trigger handler [{ability}]");
53-
if ((int)ability < 25)
54-
{
55+
if ((int) ability < (int) SpecialTriggeredAbility.NUM_ABILITIES)
56+
{
5557
return true;
5658
}
5759
if (!__instance.specialAbilities.Exists(ab => ab.Item1 == ability))

0 commit comments

Comments
 (0)