From 7bd15298a4b11a0821eeca2525c936627a8267b6 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Fri, 2 Oct 2026 15:02:29 -0500 Subject: [PATCH] fix(platform): no resync for a platform without a path A client asking to resync a simple mover that has no path got a PlatformResync anyway, and the client's simple mover then reads waypoints from its null path and crashes (LWOPlatformSimpleMover::Resync 0x00bf9ec0, Path::GetWaypointAtIndex). The two LOTs special-cased for this before are examples of the same thing. Co-Authored-By: Claude Opus 5.5 --- dGame/dComponents/MovingPlatformComponent.h | 3 +++ dGame/dGameMessages/MovementMessages.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dGame/dComponents/MovingPlatformComponent.h b/dGame/dComponents/MovingPlatformComponent.h index d78595fe3..f732b9bea 100644 --- a/dGame/dComponents/MovingPlatformComponent.h +++ b/dGame/dComponents/MovingPlatformComponent.h @@ -321,6 +321,9 @@ public: // A mover on a path, run by the server (a rotater only spins: no waypoints) bool IsMover() const; + // Whether the platform follows a path (its attached_path); a simple mover without one has no waypoints + bool HasPath() const { return m_Path != nullptr; } + private: /** diff --git a/dGame/dGameMessages/MovementMessages.cpp b/dGame/dGameMessages/MovementMessages.cpp index df82310dc..cede9c002 100644 --- a/dGame/dGameMessages/MovementMessages.cpp +++ b/dGame/dGameMessages/MovementMessages.cpp @@ -131,6 +131,9 @@ namespace GameMessages { resync.Send(sysAddr); return; } + // A platform without a path has no waypoints to resync to; the client's simple mover reads them anyway and + // crashes (LWOPlatformSimpleMover::Resync 0x00bf9ec0 -> Path::GetWaypointAtIndex on a null path) + if (platform && !platform->HasPath()) return; if (entity.GetLOT() == 6267 || entity.GetLOT() == 16141) return; PlatformResync(entity).Send(sysAddr); }