fix #652 probably

This commit is contained in:
_nebula 2024-02-06 20:31:19 +00:00
parent d93d058e22
commit 0cf735d3e5

View File

@ -121,7 +121,6 @@ public class AlarmTotemPatches : QSBPatch
} }
foreach (var player in QSBPlayerManager.PlayerList) foreach (var player in QSBPlayerManager.PlayerList)
{ {
// nebula said the error spam was annoying
if (!player.IsReady) if (!player.IsReady)
{ {
continue; continue;
@ -132,13 +131,17 @@ public class AlarmTotemPatches : QSBPatch
{ {
if (player.LightSensor.IsIlluminated()) if (player.LightSensor.IsIlluminated())
{ {
// Player is visible and illuminated.
__result = true; __result = true;
return false; return false;
} }
if (player.AssignedSimulationLantern == null) if (player.AssignedSimulationLantern == null)
{ {
// Player is not holding a lantern.
continue; continue;
} }
var lanternController = player.AssignedSimulationLantern.AttachedObject.GetLanternController(); var lanternController = player.AssignedSimulationLantern.AttachedObject.GetLanternController();
if (lanternController.IsHeldByPlayer()) if (lanternController.IsHeldByPlayer())
{ {
@ -153,14 +156,16 @@ public class AlarmTotemPatches : QSBPatch
GlobalMessenger.FireEvent("ConcealFromAlarmTotem"); GlobalMessenger.FireEvent("ConcealFromAlarmTotem");
} }
} }
__result = false;
return false; continue;
} }
__result = true; __result = true;
return false; return false;
} }
} }
} }
__result = false; __result = false;
return false; return false;
} }