Skip to content

Commit

Permalink
potentially fix mira vent bug
Browse files Browse the repository at this point in the history
  • Loading branch information
XtraCube committed Sep 23, 2024
1 parent 52daf69 commit aa2350b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions MiraAPI/Modifiers/BaseModifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ public virtual void OnDeath(DeathReason reason)
/// <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;
}
7 changes: 4 additions & 3 deletions MiraAPI/Patches/VentPatches.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using HarmonyLib;
using System.Linq;
using HarmonyLib;
using MiraAPI.Roles;
using MiraAPI.Utilities;
using UnityEngine;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit aa2350b

Please sign in to comment.