mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-20 15:41:01 +00:00
initial state for light sensors
This commit is contained in:
parent
18a083240e
commit
0def903566
@ -9,6 +9,11 @@ internal class SetIlluminatedMessage : QSBWorldObjectMessage<QSBLightSensor, boo
|
||||
|
||||
public override void OnReceiveRemote()
|
||||
{
|
||||
if (WorldObject.AttachedObject._illuminated == Data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
WorldObject.AttachedObject._illuminated = Data;
|
||||
if (Data)
|
||||
{
|
||||
|
@ -18,8 +18,6 @@ using UnityEngine;
|
||||
* leave while you still can.
|
||||
*/
|
||||
|
||||
// TODO PLEASE TEST THIS AND DEBUG YOU HAVE TO
|
||||
|
||||
namespace QSB.EchoesOfTheEye.LightSensorSync.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(SingleLightSensor))]
|
||||
|
@ -1,5 +1,7 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using QSB.AuthoritySync;
|
||||
using QSB.EchoesOfTheEye.LightSensorSync.Messages;
|
||||
using QSB.Messaging;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using System;
|
||||
@ -13,10 +15,6 @@ using System.Threading;
|
||||
namespace QSB.EchoesOfTheEye.LightSensorSync.WorldObjects;
|
||||
|
||||
/// <summary>
|
||||
/// TODO: switch this over to some sort of auth system.
|
||||
/// list of illuminators doesn't work because if a player illuminates and then leaves,
|
||||
/// it'll be considered illuminated forever until they come back.
|
||||
///
|
||||
/// BUG: this breaks in zone2.
|
||||
/// the sector it's enabled in is bigger than the sector the zone2 walls are enabled in :(
|
||||
/// maybe this can be fixed by making the collision group use the same sector.
|
||||
@ -34,7 +32,9 @@ internal class QSBLightSensor : AuthWorldObject<SingleLightSensor>
|
||||
public override void SendInitialState(uint to)
|
||||
{
|
||||
base.SendInitialState(to);
|
||||
// todo initial state
|
||||
|
||||
this.SendMessage(new SetIlluminatedMessage(AttachedObject._illuminated) { To = to });
|
||||
this.SendMessage(new IlluminatingLanternsMessage(AttachedObject._illuminatingDreamLanternList) { To = to });
|
||||
}
|
||||
|
||||
public override async UniTask Init(CancellationToken ct)
|
||||
|
Loading…
x
Reference in New Issue
Block a user