mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 12:08:52 +00:00
fix OnPlayerLeave for slides/code controller
This commit is contained in:
parent
5368d6548a
commit
fda330d768
@ -32,13 +32,16 @@ public class QSBEclipseCodeController : WorldObject<EclipseCodeController4>
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPlayerLeave(PlayerInfo obj)
|
||||
private void OnPlayerLeave(PlayerInfo player)
|
||||
{
|
||||
if (!QSBCore.IsHost)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.SendMessage(new UseControllerMessage(false));
|
||||
if (PlayerInControl == player)
|
||||
{
|
||||
this.SendMessage(new UseControllerMessage(false));
|
||||
}
|
||||
}
|
||||
|
||||
public void SetUser(uint user)
|
||||
|
@ -17,13 +17,16 @@ public class QSBSlideProjector : WorldObject<SlideProjector>
|
||||
public override void OnRemoval() =>
|
||||
QSBPlayerManager.OnRemovePlayer -= OnPlayerLeave;
|
||||
|
||||
private void OnPlayerLeave(PlayerInfo obj)
|
||||
private void OnPlayerLeave(PlayerInfo player)
|
||||
{
|
||||
if (!QSBCore.IsHost)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.SendMessage(new UseSlideProjectorMessage(false));
|
||||
if (_user == player.PlayerId)
|
||||
{
|
||||
this.SendMessage(new UseSlideProjectorMessage(false));
|
||||
}
|
||||
}
|
||||
|
||||
public override void SendInitialState(uint to) =>
|
||||
|
@ -369,7 +369,7 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart
|
||||
}
|
||||
|
||||
// stop dragging for the orbs this player was dragging
|
||||
// why tf is this here instead of QSBOrb.OnPlayerLeave?
|
||||
// i THINK this is here because orb authority is in network behavior, which may not work properly in OnPlayerLeave
|
||||
foreach (var qsbOrb in QSBWorldSync.GetWorldObjects<QSBOrb>())
|
||||
{
|
||||
if (qsbOrb.NetworkBehaviour == null)
|
||||
|
Loading…
Reference in New Issue
Block a user