mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-03 20:03:50 +00:00
fix: transport elapsed time lost millisecond precision after ~4.5 hours
elapsedTime_ was float (32-bit, ~7 significant digits). At 16384 seconds the float can only represent integers, so elapsedTime_*1000 jumps in 1-second steps — ships and elevators visibly jerk. Changed to double (53-bit mantissa) which maintains sub-millisecond precision for ~285 million years. Also changed lastServerUpdate to double to match.
This commit is contained in:
parent
ef25785404
commit
fa15a3de1f
2 changed files with 7 additions and 5 deletions
|
|
@ -64,7 +64,7 @@ struct ActiveTransport {
|
|||
bool serverYawFlipped180; // Auto-correction when server yaw is consistently opposite movement
|
||||
int serverYawAlignmentScore; // Hysteresis score for yaw flip detection
|
||||
|
||||
float lastServerUpdate; // Time of last server movement update
|
||||
double lastServerUpdate; // Time of last server movement update
|
||||
int serverUpdateCount; // Number of server updates received
|
||||
|
||||
// Dead-reckoning from latest authoritative updates (used only when updates are sparse).
|
||||
|
|
@ -147,7 +147,9 @@ private:
|
|||
rendering::WMORenderer* wmoRenderer_ = nullptr;
|
||||
rendering::M2Renderer* m2Renderer_ = nullptr;
|
||||
bool clientSideAnimation_ = false; // DISABLED - use server positions instead of client prediction
|
||||
float elapsedTime_ = 0.0f; // Total elapsed time (seconds)
|
||||
// double: float loses millisecond precision after ~4.5 hours (2^23 / 1000),
|
||||
// causing transport path interpolation to visibly jerk in long play sessions.
|
||||
double elapsedTime_ = 0.0;
|
||||
};
|
||||
|
||||
} // namespace wowee::game
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue