mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
real fix for vent
This commit is contained in:
1 parent
bbe7cd5a91
commit
bc756d5c1b
1 file changed
+12
-12
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user