Fix error when single light sensor has no sector

This commit is contained in:
Joshua Thome 2025-02-22 11:04:56 -06:00
parent d410a429fe
commit 8edc801903

View File

@ -356,9 +356,12 @@ namespace NewHorizons.Builder.Props
singleLightSensor._sector.OnSectorOccupantsUpdated -= singleLightSensor.OnSectorOccupantsUpdated;
}
singleLightSensor._sector = sector;
if (singleLightSensor._sector != null)
{
singleLightSensor._sector.OnSectorOccupantsUpdated += singleLightSensor.OnSectorOccupantsUpdated;
}
}
}
/// <summary>
/// Remove things that require sectors if the sector is null. Will just keep extending this as things pop up.