fix(scripts): AG elevator, bus door and property platform drive their movers as their live scripts did

StopPathing, StartPathing and GoToWaypoint instead of hand-made resyncs; a built platform starts before the scripts hear of it so a script can stop it; the FV tree platform's resync hack is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-30 23:36:00 -05:00
parent 83f321bec6
commit c6f6aa5d2b
5 changed files with 20 additions and 30 deletions

View File

@@ -1,7 +1,7 @@
#include "AgQbElevator.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "MovementMessages.h"
#include "MovingPlatformComponent.h"
void AgQbElevator::OnStartup(Entity* self) {
@@ -15,7 +15,8 @@ void AgQbElevator::OnQuickBuildComplete(Entity* self, Entity* target) {
float delayTime = killTime - endTime;
if (delayTime < 1) delayTime = 1;
GameMessages::PlatformResync(*self, true, 0, 0, 0, eMovementPlatformState::Stationary).Send(UNASSIGNED_SYSTEM_ADDRESS);
// L_AG_QB_ELEVATOR: it waits for its builder
if (auto* const platform = self->GetComponent<MovingPlatformComponent>()) platform->StopPathing();
//add a timer that will kill the QB if no players get on in the killTime
self->AddTimer("startKillTimer", killTime);
@@ -32,7 +33,7 @@ void AgQbElevator::OnProximityUpdate(Entity* self, Entity* entering, std::string
self->SetBoolean(u"qbPlayerRdy", true);
self->CancelTimer("StartElevator");
GameMessages::PlatformResync(*self, true, 0, 1, 1, eMovementPlatformState::Moving).Send(UNASSIGNED_SYSTEM_ADDRESS);
if (auto* const platform = self->GetComponent<MovingPlatformComponent>()) platform->StartPathing();
} else if (!self->GetBoolean(u"StartTimer")) {
self->SetBoolean(u"StartTimer", true);
self->AddTimer("StartElevator", startTime);
@@ -43,7 +44,7 @@ void AgQbElevator::OnProximityUpdate(Entity* self, Entity* entering, std::string
void AgQbElevator::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "StartElevator") {
GameMessages::PlatformResync(*self, true, 0, 1, 1, eMovementPlatformState::Moving).Send(UNASSIGNED_SYSTEM_ADDRESS);
if (auto* const platform = self->GetComponent<MovingPlatformComponent>()) platform->StartPathing();
} else if (timerName == "startKillTimer") {
killTimerStartup(self);
} else if (timerName == "KillTimer") {