Skip to content

Commit

Permalink
Fixed Room.Blackout not turning off lights (#2319)
Browse files Browse the repository at this point in the history
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
Co-authored-by: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 11, 2023
1 parent 048dc8b commit 87f5418
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Exiled.API/Features/Room.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,19 @@ public static Room FindParentRoom(GameObject objectInRoom)
/// <summary>
/// Flickers the room's lights off for a duration.
/// </summary>
/// <param name="duration">Duration in seconds.</param>
public void TurnOffLights(float duration)
/// <param name="duration">Duration in seconds, or -1 for an indefinite duration.</param>
public void TurnOffLights(float duration = -1)
{
if (duration == -1)
{
foreach (RoomLightController light in RoomLightControllers)
{
light.SetLights(false);
}

return;
}

foreach (RoomLightController light in RoomLightControllers)
{
light.ServerFlickerLights(duration);
Expand Down

0 comments on commit 87f5418

Please sign in to comment.