quantum-space-buddies/QSB/EchoesOfTheEye/DreamWorld/Messages/ExitDreamWorldMessage.cs
JohnCorby 401a4dc0d7 doc
2022-03-25 18:58:08 -07:00

34 lines
662 B
C#

using JetBrains.Annotations;
using QSB.Messaging;
using QSB.Player;
using QSB.Player.TransformSync;
namespace QSB.EchoesOfTheEye.DreamWorld.Messages;
/// <summary>
/// todo initial state
/// </summary>
[UsedImplicitly]
internal class ExitDreamWorldMessage : QSBMessage
{
static ExitDreamWorldMessage()
{
GlobalMessenger.AddListener(OWEvents.ExitDreamWorld, () =>
{
if (!PlayerTransformSync.LocalInstance)
{
return;
}
new ExitDreamWorldMessage().Send();
});
}
public override void OnReceiveRemote()
{
var player = QSBPlayerManager.GetPlayer(From);
player.InDreamWorld = false;
player.AssignedSimulationLantern = null;
}
}