2022-04-07 08:57:51 +01:00
|
|
|
|
using QSB.EchoesOfTheEye.Ghosts.WorldObjects;
|
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.Utility;
|
|
|
|
|
|
|
|
|
|
namespace QSB.EchoesOfTheEye.Ghosts.Messages;
|
|
|
|
|
|
|
|
|
|
internal class ChangeActionMessage : QSBWorldObjectMessage<QSBGhostBrain, GhostAction.Name>
|
|
|
|
|
{
|
|
|
|
|
public ChangeActionMessage(GhostAction.Name name) : base(name) { }
|
|
|
|
|
|
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
2022-04-10 14:12:29 +01:00
|
|
|
|
if (QSBCore.IsHost)
|
|
|
|
|
{
|
|
|
|
|
DebugLog.ToConsole("Error - Received ChangeActionMessage on host. Something has gone horribly wrong!", OWML.Common.MessageType.Error);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-07 08:57:51 +01:00
|
|
|
|
DebugLog.DebugWrite($"{WorldObject.AttachedObject._name} Change action to {Data}");
|
2022-04-09 23:46:49 -07:00
|
|
|
|
WorldObject.ChangeAction(WorldObject.GetAction(Data), true);
|
2022-04-07 08:57:51 +01:00
|
|
|
|
}
|
2022-04-10 15:02:32 -07:00
|
|
|
|
}
|