mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-19 02:05:28 +00:00
fix(moving platform): a rotater only spins (start/stop), it doesn't run a mover's waypoints
LWOPlatformRotator's HandleStoppedLogic (0x00bdc660) only keeps its angular velocity from rotX/rotY/rotZ and rate; its path never arrives. No live zone sets platformIsRotater. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -152,6 +152,11 @@ MovingPlatformComponent::MovingPlatformComponent(Entity* parent, const int32_t c
|
|||||||
MoverProcessStateChange(m_StartWaypoint);
|
MoverProcessStateChange(m_StartWaypoint);
|
||||||
const bool startOnLoad = !m_Parent->HasVar(u"startPathingOnLoad") || m_Parent->GetVar<bool>(u"startPathingOnLoad");
|
const bool startOnLoad = !m_Parent->HasVar(u"startPathingOnLoad") || m_Parent->GetVar<bool>(u"startPathingOnLoad");
|
||||||
MoverStopAtWaypoint(startOnLoad);
|
MoverStopAtWaypoint(startOnLoad);
|
||||||
|
} else if (m_MoverSubComponentType == eMoverSubComponentType::rotater) {
|
||||||
|
// LWOPlatformRotator: it only spins (rotX/rotY/rotZ at rate, its own path never arrives anywhere: its
|
||||||
|
// HandleStoppedLogic 0x00bdc660 only keeps the angular velocity), while travelling
|
||||||
|
const bool startOnLoad = !m_Parent->HasVar(u"startPathingOnLoad") || m_Parent->GetVar<bool>(u"startPathingOnLoad");
|
||||||
|
GetMoverSubComponent()->mState = startOnLoad ? ePlatformStateFlag::Travelling : ePlatformStateFlag::Stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Live constructed every moving platform with simple physics as keyframed
|
// Live constructed every moving platform with simple physics as keyframed
|
||||||
@@ -302,6 +307,12 @@ void MovingPlatformComponent::StartPathing() {
|
|||||||
SimpleMoverGotoWaypoint(GetSimpleMoverSubComponent()->mCurrentWaypointIndex == 0 ? 1 : 0);
|
SimpleMoverGotoWaypoint(GetSimpleMoverSubComponent()->mCurrentWaypointIndex == 0 ? 1 : 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (m_MoverSubComponentType == eMoverSubComponentType::rotater) {
|
||||||
|
// LWOPlatformRotator::StartLinearMovement: spinning again
|
||||||
|
GetMoverSubComponent()->mState = ePlatformStateFlag::Travelling;
|
||||||
|
Game::entityManager->SerializeEntity(m_Parent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!IsMover()) return;
|
if (!IsMover()) return;
|
||||||
m_PathingStopped = false;
|
m_PathingStopped = false;
|
||||||
auto* const mover = GetMoverSubComponent();
|
auto* const mover = GetMoverSubComponent();
|
||||||
@@ -319,6 +330,12 @@ void MovingPlatformComponent::StopPathing() {
|
|||||||
Game::entityManager->SerializeEntity(m_Parent);
|
Game::entityManager->SerializeEntity(m_Parent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (m_MoverSubComponentType == eMoverSubComponentType::rotater) {
|
||||||
|
// LWOPlatformRotator::StopPlatform: no longer spinning
|
||||||
|
GetMoverSubComponent()->mState = ePlatformStateFlag::Stopped;
|
||||||
|
Game::entityManager->SerializeEntity(m_Parent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!IsMover()) return;
|
if (!IsMover()) return;
|
||||||
m_PathingStopped = true;
|
m_PathingStopped = true;
|
||||||
auto* const mover = GetMoverSubComponent();
|
auto* const mover = GetMoverSubComponent();
|
||||||
@@ -331,8 +348,7 @@ void MovingPlatformComponent::StopPathing() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool MovingPlatformComponent::IsMover() const {
|
bool MovingPlatformComponent::IsMover() const {
|
||||||
return (m_MoverSubComponentType == eMoverSubComponentType::mover || m_MoverSubComponentType == eMoverSubComponentType::rotater) &&
|
return m_MoverSubComponentType == eMoverSubComponentType::mover && m_Path != nullptr && !m_Path->pathWaypoints.empty();
|
||||||
m_Path != nullptr && !m_Path->pathWaypoints.empty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LWOPlatform::ProcessStateChange: the waypoint becomes the current one, the next follows from the path's behavior and
|
// LWOPlatform::ProcessStateChange: the waypoint becomes the current one, the next follows from the path's behavior and
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ public:
|
|||||||
// The mover's state as a PlatformResync gives it (RequestPlatformResync)
|
// The mover's state as a PlatformResync gives it (RequestPlatformResync)
|
||||||
void FillResync(GameMessages::PlatformResync& resync) const;
|
void FillResync(GameMessages::PlatformResync& resync) const;
|
||||||
|
|
||||||
// A mover (or rotater) on a path, run by the server
|
// A mover on a path, run by the server (a rotater only spins: no waypoints)
|
||||||
bool IsMover() const;
|
bool IsMover() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user