mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-11 06:40:39 +00:00
rework _illuminated = false with auth
This commit is contained in:
parent
ba83ed2276
commit
6edc85dbcc
@ -59,18 +59,23 @@ internal class LightSensorPatches : QSBPatch
|
|||||||
{
|
{
|
||||||
if (__instance._illuminated)
|
if (__instance._illuminated)
|
||||||
{
|
{
|
||||||
qsbLightSensor._locallyIlluminated = false;
|
|
||||||
qsbLightSensor.OnDetectLocalDarkness?.Invoke();
|
|
||||||
// wait because someone could send a message getting ownership again
|
|
||||||
Delay.RunFramesLater(10, () =>
|
Delay.RunFramesLater(10, () =>
|
||||||
{
|
{
|
||||||
|
// no one else took ownership, so we can safely make not illuminated
|
||||||
if (qsbLightSensor.Owner == 0)
|
if (qsbLightSensor.Owner == 0)
|
||||||
{
|
{
|
||||||
|
__instance._illuminated = false;
|
||||||
__instance.OnDetectDarkness.Invoke();
|
__instance.OnDetectDarkness.Invoke();
|
||||||
|
qsbLightSensor.SendMessage(new SetIlluminatedMessage(false));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
__instance._illuminated = false;
|
|
||||||
|
if (qsbLightSensor._locallyIlluminated)
|
||||||
|
{
|
||||||
|
qsbLightSensor._locallyIlluminated = false;
|
||||||
|
qsbLightSensor.OnDetectLocalDarkness?.Invoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user