mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
various fixes
This commit is contained in:
1 parent
ba1d79cce1
commit
dcacd73c03
20 files changed
+52
-52
No files matched your search
@@ -85,6 +85,9 @@ internal static class ExtendedPlayerControl
|
||||
|
||||
public static bool CanUseVent(this PlayerControl player, int ventId)
|
||||
{
|
||||
int? closestVentId = player.GetClosestVent()?.Id;
|
||||
if (player.inVent && closestVentId == ventId) return true;
|
||||
|
||||
switch (Options.CurrentGameMode)
|
||||
{
|
||||
case CustomGameMode.RoomRush:
|
||||
@@ -96,9 +99,8 @@ internal static class ExtendedPlayerControl
|
||||
}
|
||||
|
||||
if (player.Is(CustomRoles.Trainee) && MeetingStates.FirstMeeting) return false;
|
||||
if (player.Is(CustomRoles.Blocked) && player.GetClosestVent()?.Id != ventId) return false;
|
||||
if (player.Is(CustomRoles.Blocked) && closestVentId != ventId) return false;
|
||||
if (!GameStates.IsInTask || ExileController.Instance || AntiBlackout.SkipTasks || Main.Invisible.Contains(player.PlayerId)) return false;
|
||||
if (player.inVent && player.GetClosestVent()?.Id == ventId) return true;
|
||||
return (player.CanUseImpostorVentButton() || player.GetRoleTypes() == RoleTypes.Engineer) && Main.PlayerStates.Values.All(x => x.Role.CanUseVent(player, ventId));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user