mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 09:35:26 +00:00
fix #544
This commit is contained in:
parent
04c113f148
commit
e8d49ca102
@ -35,7 +35,17 @@ internal class QSBLightSensor : WorldObject<SingleLightSensor>
|
||||
}
|
||||
}
|
||||
|
||||
public override async UniTask Init(CancellationToken ct) => QSBPlayerManager.OnRemovePlayer += OnPlayerLeave;
|
||||
public override async UniTask Init(CancellationToken ct)
|
||||
{
|
||||
QSBPlayerManager.OnRemovePlayer += OnPlayerLeave;
|
||||
_locallyIlluminated = AttachedObject._startIlluminated;
|
||||
|
||||
if (_locallyIlluminated)
|
||||
{
|
||||
_illuminatedBy.Add(QSBPlayerManager.LocalPlayerId);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoval() => QSBPlayerManager.OnRemovePlayer -= OnPlayerLeave;
|
||||
private void OnPlayerLeave(PlayerInfo player) => SetIlluminated(player.PlayerId, false);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user