2022-04-09 14:20:36 -07:00
|
|
|
|
using QSB.EchoesOfTheEye.Ghosts.WorldObjects;
|
2022-04-07 08:57:51 +01:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.Utility;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace QSB.EchoesOfTheEye.Ghosts.Messages;
|
|
|
|
|
|
2022-04-09 14:23:57 -07:00
|
|
|
|
internal class PathfindLocalPositionMessage : QSBWorldObjectMessage<QSBGhostController,
|
|
|
|
|
(Vector3 localPosition, float speed, float acceleration)>
|
2022-04-07 08:57:51 +01:00
|
|
|
|
{
|
2022-04-09 14:23:57 -07:00
|
|
|
|
public PathfindLocalPositionMessage(Vector3 localPosition, float speed, float acceleration) :
|
|
|
|
|
base((localPosition, speed, acceleration)) { }
|
2022-04-07 08:57:51 +01:00
|
|
|
|
|
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
|
|
|
|
if (QSBCore.IsHost)
|
|
|
|
|
{
|
2022-04-09 14:20:36 -07:00
|
|
|
|
DebugLog.ToConsole("Error - Received PathfindLocalPositionMessage on host. Something has gone horribly wrong!", OWML.Common.MessageType.Error);
|
2022-04-07 08:57:51 +01:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-09 23:46:49 -07:00
|
|
|
|
WorldObject.PathfindToLocalPosition(Data.localPosition, Data.speed, Data.acceleration, true);
|
2022-04-07 08:57:51 +01:00
|
|
|
|
}
|
|
|
|
|
}
|