mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
potentially fix mira vent bug
This commit is contained in:
1 parent
52daf69dfe
commit
aa2350bedf
2 files changed
+6
-5
No files matched your search
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user