fix(njhub): a built counterweight goes down by itself, and the scripts hear it arrive

Live (the Frakjaw battle captures, LOT 16141): when its quick build completes the simple mover is serialized waiting at waypoint 0 (9) and about 0.1 s later travelling (2); it stops at its end without a serialization. That is the client's LWOPlatform, active once the quick build is complete (SendMessage 0x00bdc930), waiting the shortest wait and setting off (RunPlatform 0x00c86e10). L_CAVE_PRISON_CAGE and L_MONASTERY_BOSS_INSTANCE_SERVER never send it: they ask to be told of its PlatformAtLastWaypoint, and act then.

So the simple mover sets off when it is built, the cave prison's button goes down when the counterweight arrives instead of when it is built, and Frakjaw is hit when it arrives (0.1 s and the row's 1 s after the build) instead of on a 0.5 s timer with a counterweight that never moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-10 13:39:48 -06:00
parent 11d7455cad
commit 7f62425456
5 changed files with 130 additions and 49 deletions

View File

@@ -6,6 +6,7 @@
#ifndef MOVINGPLATFORMCOMPONENT_H
#define MOVINGPLATFORMCOMPONENT_H
#include <functional>
#include <memory>
#include <vector>
@@ -275,6 +276,12 @@ public:
eMoverSubComponentType GetMoverSubComponentType() const { return m_MoverSubComponentType; }
/**
* Calls back whenever the platform is at the last waypoint of its path (the PlatformAtLastWaypoint game message,
* which live's scripts ask to be notified of on the NJ counterweights)
*/
void AddPlatformAtLastWaypointCallback(const std::function<void()>& callback);
/**
* Called when a simple mover gets to the waypoint it was sent to: the client's LWOPlatform::ArrivedAtWaypoint
* and HandleWaypointArrived (Arrived, then ArrivedAtDesiredWaypoint and PlatformAtLastWaypoint)
@@ -315,6 +322,8 @@ private:
*/
std::vector<std::unique_ptr<PlatformSubComponent>> m_SubComponents;
std::vector<std::function<void()>> m_AtLastWaypointCallbacks;
// The object's quick build, looked up when the platform first runs
class QuickBuildComponent* m_QuickBuild = nullptr;
bool m_CheckedQuickBuild = false;