mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-12-11 20:15:10 +01:00
fix #521
This commit is contained in:
parent
f8454f8f9d
commit
32f14237c5
@ -8,8 +8,8 @@ namespace QSB.EchoesOfTheEye.AirlockSync.WorldObjects;
|
||||
public class QSBAirlockInterface : QSBRotatingElements<AirlockInterface, AirlockVariableSyncer>
|
||||
{
|
||||
protected override IEnumerable<SingleLightSensor> LightSensors => AttachedObject._lightSensors;
|
||||
|
||||
protected override GameObject NetworkObjectPrefab => QSBNetworkManager.singleton.AirlockPrefab;
|
||||
protected override bool LockedActive => AttachedObject.enabled;
|
||||
|
||||
public override string ReturnLabel()
|
||||
{
|
||||
|
||||
@ -7,6 +7,7 @@ using QSB.WorldSync;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using QSB.Utility;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.EchoesOfTheEye;
|
||||
@ -16,6 +17,7 @@ public abstract class QSBRotatingElements<T, U> : LinkedWorldObject<T, U>
|
||||
where U : NetworkBehaviour
|
||||
{
|
||||
protected abstract IEnumerable<SingleLightSensor> LightSensors { get; }
|
||||
protected virtual bool LockedActive => false;
|
||||
private QSBLightSensor[] _qsbLightSensors;
|
||||
private int _litSensors;
|
||||
|
||||
@ -61,7 +63,9 @@ public abstract class QSBRotatingElements<T, U> : LinkedWorldObject<T, U>
|
||||
_litSensors--;
|
||||
if (_litSensors == 0)
|
||||
{
|
||||
NetworkBehaviour.netIdentity.UpdateOwnerQueue(OwnerQueueAction.Remove);
|
||||
Delay.RunWhen(
|
||||
() => LockedActive == false,
|
||||
() => NetworkBehaviour.netIdentity.UpdateOwnerQueue(OwnerQueueAction.Remove));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user