mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-11 15:40:46 +00:00
Revert "OnPlayerLeave"
This reverts commit e2c2be9355a75d2d37ea7a5514a0f75b472ff2b7.
This commit is contained in:
parent
b825fc588b
commit
c1df1ce3d4
@ -1,10 +1,7 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using QSB.EchoesOfTheEye.LightSensorSync.Messages;
|
||||
using QSB.EchoesOfTheEye.LightSensorSync.Messages;
|
||||
using QSB.Messaging;
|
||||
using QSB.Player;
|
||||
using QSB.WorldSync;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace QSB.EchoesOfTheEye.LightSensorSync.WorldObjects;
|
||||
|
||||
@ -19,16 +16,4 @@ internal class QSBLightSensor : WorldObject<SingleLightSensor>
|
||||
|
||||
public override void SendInitialState(uint to) =>
|
||||
this.SendMessage(new LightSensorAuthorityMessage(AuthorityOwner) { To = to });
|
||||
|
||||
public override async UniTask Init(CancellationToken ct) => QSBPlayerManager.OnRemovePlayer += OnPlayerLeave;
|
||||
public override void OnRemoval() => QSBPlayerManager.OnRemovePlayer -= OnPlayerLeave;
|
||||
|
||||
private void OnPlayerLeave(PlayerInfo player)
|
||||
{
|
||||
if (AuthorityOwner == player.PlayerId)
|
||||
{
|
||||
// player left with authority, give it to us if we can
|
||||
this.SendMessage(new LightSensorAuthorityMessage(AttachedObject.enabled ? QSBPlayerManager.LocalPlayerId : 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user