potentially fix mira vent bug

This commit is contained in:
XtraCube committed 2024-09-23 15:59:42 -04:00
1 parent 52daf69dfe
commit aa2350bedf
2 files changed
+6 -5

No files matched your search

+2 -2
View File
@@ -75,6 +75,6 @@ public abstract class BaseModifier
/// <summary>
/// Determines whether the player can vent.
/// </summary>
/// <returns>True if the player can vent, false otherwise.</returns>
public virtual bool CanVent() => Player?.Data.Role.CanVent == true;
/// <returns>True if the player can vent, false otherwise. Null for no effect.</returns>
public virtual bool? CanVent() => null;
}
+4 -3
View File
@@ -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 class VentPatches
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;
}