real fix for vent

This commit is contained in:
XtraCube committed 2024-09-23 16:17:58 -04:00
1 parent bbe7cd5a91
commit bc756d5c1b
1 file changed
+12 -12
+12 -12
View File
@@ -2,6 +2,7 @@
using HarmonyLib;
using MiraAPI.Roles;
using MiraAPI.Utilities;
using Reactor.Utilities;
using UnityEngine;
namespace MiraAPI.Patches;
@@ -23,21 +24,20 @@ public static class VentPatches
var role = @object.Data.Role;
var canVent = role is ICustomRole customRole ? customRole.Configuration.CanUseVent : role.CanVent;
couldUse = canVent;
var modifiers = @object.GetModifierComponent()?.ActiveModifiers;
if (modifiers is null || modifiers.Count <= 0)
if (modifiers is { Count: > 0 })
{
return;
}
switch (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().HasValue && x.CanVent()==true):
couldUse = true;
break;
switch (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().HasValue && x.CanVent()==true):
couldUse = true;
break;
}
}
var num = float.MaxValue;