From c1df1ce3d4a48dd9baba1a44b78a73676af55b4c Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 27 May 2022 15:03:29 -0700 Subject: [PATCH] Revert "OnPlayerLeave" This reverts commit e2c2be9355a75d2d37ea7a5514a0f75b472ff2b7. --- .../WorldObjects/QSBLightSensor.cs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/QSB/EchoesOfTheEye/LightSensorSync/WorldObjects/QSBLightSensor.cs b/QSB/EchoesOfTheEye/LightSensorSync/WorldObjects/QSBLightSensor.cs index 30e8ee45..10571fbc 100644 --- a/QSB/EchoesOfTheEye/LightSensorSync/WorldObjects/QSBLightSensor.cs +++ b/QSB/EchoesOfTheEye/LightSensorSync/WorldObjects/QSBLightSensor.cs @@ -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 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)); - } - } }