mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-16 16:55:27 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user