diff --git a/MiraAPI/Modifiers/BaseModifier.cs b/MiraAPI/Modifiers/BaseModifier.cs index 9d6e82c..47cd491 100644 --- a/MiraAPI/Modifiers/BaseModifier.cs +++ b/MiraAPI/Modifiers/BaseModifier.cs @@ -75,6 +75,6 @@ public virtual void OnDeath(DeathReason reason) /// /// Determines whether the player can vent. /// - /// True if the player can vent, false otherwise. - public virtual bool CanVent() => Player?.Data.Role.CanVent == true; + /// True if the player can vent, false otherwise. Null for no effect. + public virtual bool? CanVent() => null; } diff --git a/MiraAPI/Patches/VentPatches.cs b/MiraAPI/Patches/VentPatches.cs index 77f1c1a..cdd40cb 100644 --- a/MiraAPI/Patches/VentPatches.cs +++ b/MiraAPI/Patches/VentPatches.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +using System.Linq; +using HarmonyLib; using MiraAPI.Roles; using MiraAPI.Utilities; using UnityEngine; @@ -31,10 +32,10 @@ public static void VentCanUsePostfix(Vent __instance, ref float __result, [Harmo switch (canVent) { - case true when modifiers.Exists(x => !x.CanVent()): + case true when modifiers.Exists(x => x.CanVent().HasValue && x.CanVent()==false): couldUse = canUse = false; return; - case false when modifiers.Exists(x => x.CanVent()): + case false when modifiers.Exists(x => x.CanVent().HasValue && x.CanVent()==true): couldUse = true; break; }