mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 07:47:13 +00:00
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:
@@ -518,6 +518,13 @@ void QuickBuildComponent::CompleteQuickBuild(Entity* const user) {
|
||||
Loot::DropActivityLoot(builder, m_Parent->GetObjectID(), m_ActivityId, 1);
|
||||
}
|
||||
|
||||
// A built platform sets off before the scripts hear of it, so a script that stops it (live's L_AG_QB_ELEVATOR and
|
||||
// L_PROP_PLATFORM stop theirs) keeps it stopped
|
||||
auto* movingPlatform = m_Parent->GetComponent<MovingPlatformComponent>();
|
||||
if (movingPlatform != nullptr) {
|
||||
movingPlatform->OnCompleteQuickBuild();
|
||||
}
|
||||
|
||||
// Notify scripts
|
||||
auto* script = m_Parent->GetScript();
|
||||
script->OnQuickBuildComplete(m_Parent, user);
|
||||
@@ -531,11 +538,6 @@ void QuickBuildComponent::CompleteQuickBuild(Entity* const user) {
|
||||
|
||||
m_Parent->TriggerEvent(eTriggerEventType::REBUILD_COMPLETE, user);
|
||||
|
||||
auto* movingPlatform = m_Parent->GetComponent<MovingPlatformComponent>();
|
||||
if (movingPlatform != nullptr) {
|
||||
movingPlatform->OnCompleteQuickBuild();
|
||||
}
|
||||
|
||||
// Set flag
|
||||
auto* character = user->GetCharacter();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user