mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 09:35:26 +00:00
PathfindLocalPositionMessage: local position is relative to nodemap
This commit is contained in:
parent
eddd4413a9
commit
6cb00269fc
@ -1,14 +1,8 @@
|
||||
using GhostEnums;
|
||||
using QSB.EchoesOfTheEye.Ghosts.WorldObjects;
|
||||
using QSB.EchoesOfTheEye.Ghosts.WorldObjects;
|
||||
using QSB.Messaging;
|
||||
using QSB.SectorSync.WorldObjects;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.EchoesOfTheEye.Ghosts.Messages;
|
||||
@ -35,14 +29,14 @@ internal class PathfindLocalPositionMessage : QSBWorldObjectMessage<QSBGhostCont
|
||||
{
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Received PathfindLocalPositionMessage on host. Something has gone horribly wrong!", OWML.Common.MessageType.Error);
|
||||
DebugLog.ToConsole("Error - Received PathfindLocalPositionMessage on host. Something has gone horribly wrong!", OWML.Common.MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
var sector = QSBWorldSync.GetWorldObject<QSBSector>(Data.sectorId);
|
||||
var sector = Data.sectorId.GetWorldObject<QSBSector>();
|
||||
var worldPos = sector.AttachedObject.transform.TransformPoint(Data.localPosition);
|
||||
|
||||
DebugLog.DebugWrite($"{WorldObject.AttachedObject.name} Pathfind to local position {WorldObject.AttachedObject.transform.InverseTransformPoint(worldPos)} with speed:{Data.speed}, acceleration:{Data.acceleration}");
|
||||
WorldObject.AttachedObject.PathfindToLocalPosition(WorldObject.AttachedObject.transform.InverseTransformPoint(worldPos), Data.speed, Data.acceleration);
|
||||
WorldObject.AttachedObject.PathfindToLocalPosition(WorldObject.AttachedObject.WorldToLocalPosition(worldPos), Data.speed, Data.acceleration);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user