disable time sync when past certain eye state

This commit is contained in:
JohnCorby 2021-12-31 02:38:37 -08:00
parent e8803ac6c8
commit 2eda59044d

View File

@ -1,7 +1,7 @@
using QSB.Menus;
using QSB.Messaging;
using QSB.Messaging;
using QSB.Player;
using QSB.Player.TransformSync;
using QSB.TimeSync;
using QSB.WorldSync;
namespace QSB.EyeOfTheUniverse.EyeStateSync.Messages
@ -26,12 +26,22 @@ namespace QSB.EyeOfTheUniverse.EyeStateSync.Messages
public override void OnReceiveLocal()
{
QSBPlayerManager.LocalPlayer.EyeState = Value;
if (Value >= EyeState.ForestIsDark)
{
WakeUpSync.LocalInstance.enabled = false;
}
}
public override void OnReceiveRemote()
{
var player = QSBPlayerManager.GetPlayer(From);
player.EyeState = Value;
if (Value >= EyeState.ForestIsDark)
{
WakeUpSync.LocalInstance.enabled = false;
}
}
}
}