From 6ff42bf312fb1a9aab9baa77b04c7bfb2b250702 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Thu, 1 Oct 2026 04:55:03 -0500 Subject: [PATCH] fix(moving platform): a mover started at a waypoint waits there first (issue 964) LWOPlatform::ResumeTravelling: not travelling at a waypoint it waits the waypoint's wait; the AG monument elevator rose at once. Co-Authored-By: Claude Opus 5.5 --- dGame/dComponents/MovingPlatformComponent.cpp | 7 +++++++ .../dComponentsTests/MovingPlatformComponentTests.cpp | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dGame/dComponents/MovingPlatformComponent.cpp b/dGame/dComponents/MovingPlatformComponent.cpp index 7e799aa43..e30a67777 100644 --- a/dGame/dComponents/MovingPlatformComponent.cpp +++ b/dGame/dComponents/MovingPlatformComponent.cpp @@ -317,6 +317,13 @@ void MovingPlatformComponent::StartPathing() { m_PathingStopped = false; auto* const mover = GetMoverSubComponent(); if ((mover->mState & ePlatformStateFlag::Travelling) != 0) return; + // LWOPlatform::ResumeTravelling: stopped between two waypoints it carries on; at a waypoint it first waits there + // for the waypoint's wait (issue 964: the AG monument elevator waited about 2 s before rising) + if ((mover->mState & ePlatformStateFlag::ReachedDesiredWaypoint) != 0) { + MoverStopAtWaypoint(true); + Game::entityManager->SerializeEntity(m_Parent); + return; + } MoverDepart(); } diff --git a/tests/dGameTests/dComponentsTests/MovingPlatformComponentTests.cpp b/tests/dGameTests/dComponentsTests/MovingPlatformComponentTests.cpp index e64df48af..cc6895b6b 100644 --- a/tests/dGameTests/dComponentsTests/MovingPlatformComponentTests.cpp +++ b/tests/dGameTests/dComponentsTests/MovingPlatformComponentTests.cpp @@ -217,8 +217,11 @@ TEST_F(MovingPlatformComponentTest, MoverRunsLikeLive) { platform->Update(10.0f); EXPECT_EQ(mover->mState, 25u); - // Stopped mid way, then started again + // Started at a waypoint it first waits there (issue 964), then stopped mid way and started again platform->StartPathing(); + EXPECT_EQ(mover->mState, 25u); + platform->Update(2.1f); + EXPECT_EQ(mover->mState, 2u); platform->Update(1.0f); platform->StopPathing(); EXPECT_EQ(mover->mState & 1u, 1u);