mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-18 17:55:27 +00:00
fix(moving platform): a mover keeps its velocity through a wait between the ends, as live
Live serialized a mover leaving a waypoint not where the waypoint is but past it: the GF shooting gallery subs 2 units on (speed 15), the FV dragons 5.33 (speed 40), each along the stretch they came by, and a dragon met 2.2 s into its 5 s wait was 88 units past its waypoint (1.219 of the next stretch). At either end of a path they left from the waypoint itself. It is the client's LWOPlatform at work, which the server ran too: - SetWaitingTime (0x00bdc860) takes the object's velocities away only when the platform has stopped or is at an end of its path, so through a wait in between the object goes on as it came; - the percent is how far the object is from the waypoint (CalculatePercentTravelledToWaypoint 0x00be9050); - UpdateVelocities (0x00bd4330) on leaving turns it the next stretch's way from where it is, and it arrives when it passes the next waypoint (CloseToNextWaypoint 0x00bd4140), where ProcessStateChange (0x00cce380) puts it at the waypoint; - a platform that has not stopped looks whether it arrived while it waits too (HandleStoppedLogic 0x00bd16a0): the dragons were at waypoint 5 without having left 4. The server's mover now moves by its velocity in the same way, so the state it sends on leaving carries the place and percent live sent. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -95,8 +95,12 @@ public:
|
||||
bool mShouldStopAtDesiredWaypoint = false;
|
||||
// From the current waypoint (0) to the next (1)
|
||||
float mPercentBetweenPoints = 0;
|
||||
// Where it is now (current waypoint + percent towards the next)
|
||||
// Where it is now: its object's position, which its linear velocity moves
|
||||
NiPoint3 mPosition{};
|
||||
// The linear velocity LWOPlatform::SetLinearVelocity 0x00be9200 gave its object when it last set off (or last looked,
|
||||
// between waypoints of different speeds). It is only taken away where the platform stops and at either end of the
|
||||
// path (SetWaitingTime 0x00bdc860), so through a wait at a waypoint in between the object goes on as it came.
|
||||
NiPoint3 mVelocity{};
|
||||
uint32_t mCurrentWaypointIndex = 0;
|
||||
uint32_t mNextWaypointIndex = 0;
|
||||
// Time spent at the waypoint, and how long it waits there (LWOPlatform::SetWaitingTime 0x00bdc860: the waypoint's
|
||||
@@ -373,6 +377,8 @@ private:
|
||||
bool UpdateActive(PlatformSubComponent& platform);
|
||||
// LWOPlatform::SetWaitingTime: starts a wait of at least 0.1 s
|
||||
void MoverSetWaitingTime(float waitTime, float idleTimeElapsed);
|
||||
// LWOPlatform::UpdateVelocities 0x00bd4330: the velocity towards the next waypoint at the speed for where it is
|
||||
void MoverUpdateVelocities();
|
||||
// LWOPlatform::ResumeTravelling: stopped between two waypoints it travels on; at a waypoint it first waits there
|
||||
void MoverResumeTravelling();
|
||||
// LWOPlatform::ArrivedAtWaypoint: once it is at its next waypoint
|
||||
|
||||
Reference in New Issue
Block a user