mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-06 01:00:16 +00:00
_illuminatingDreamLanternList can sometimes be null
This commit is contained in:
parent
15ab10e05f
commit
a26b8de8d1
@ -140,8 +140,11 @@ internal class LightSensorPatches : QSBPatch
|
||||
__instance._fixedUpdateFrameDelayCount--;
|
||||
}
|
||||
|
||||
_prevIlluminatingDreamLanternList.Clear();
|
||||
_prevIlluminatingDreamLanternList.AddRange(__instance._illuminatingDreamLanternList);
|
||||
if (__instance._illuminatingDreamLanternList != null)
|
||||
{
|
||||
_prevIlluminatingDreamLanternList.Clear();
|
||||
_prevIlluminatingDreamLanternList.AddRange(__instance._illuminatingDreamLanternList);
|
||||
}
|
||||
|
||||
var illuminated = __instance._illuminated;
|
||||
__instance.UpdateIllumination();
|
||||
@ -162,7 +165,8 @@ internal class LightSensorPatches : QSBPatch
|
||||
qsbLightSensor.SendMessage(new SetIlluminatedMessage(false));
|
||||
}
|
||||
|
||||
if (!__instance._illuminatingDreamLanternList.SequenceEqual(_prevIlluminatingDreamLanternList))
|
||||
if (__instance._illuminatingDreamLanternList != null
|
||||
&& !__instance._illuminatingDreamLanternList.SequenceEqual(_prevIlluminatingDreamLanternList))
|
||||
{
|
||||
qsbLightSensor.SendMessage(new IlluminatingLanternsMessage(__instance._illuminatingDreamLanternList));
|
||||
}
|
||||
|
@ -21,7 +21,10 @@ internal class QSBLightSensor : WorldObject<SingleLightSensor>
|
||||
public override void SendInitialState(uint to)
|
||||
{
|
||||
this.SendMessage(new IlluminatedByMessage(_illuminatedBy.ToArray()) { To = to });
|
||||
this.SendMessage(new IlluminatingLanternsMessage(AttachedObject._illuminatingDreamLanternList) { To = to });
|
||||
if (AttachedObject._illuminatingDreamLanternList != null)
|
||||
{
|
||||
this.SendMessage(new IlluminatingLanternsMessage(AttachedObject._illuminatingDreamLanternList) { To = to });
|
||||
}
|
||||
}
|
||||
|
||||
public override async UniTask Init(CancellationToken ct) => QSBPlayerManager.OnRemovePlayer += OnPlayerLeave;
|
||||
|
Loading…
Reference in New Issue
Block a user