From 3fa6ea4cea758e15f4590fbee38be0024b7fbe4a Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Mon, 14 Nov 2022 13:57:49 -0600 Subject: [PATCH] Fix ninjago crashes (#837) Fixed reading speed from rail paths Made the config of rail paths be read in sanely due to not having a type Fixes #835 --- dZoneManager/Zone.cpp | 4 +++- dZoneManager/Zone.h | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dZoneManager/Zone.cpp b/dZoneManager/Zone.cpp index adf66dc9..ec73237e 100644 --- a/dZoneManager/Zone.cpp +++ b/dZoneManager/Zone.cpp @@ -504,6 +504,8 @@ void Zone::LoadPath(std::istream& file) { BinaryIO::BinaryRead(file, waypoint.racing.planeWidth); BinaryIO::BinaryRead(file, waypoint.racing.planeHeight); BinaryIO::BinaryRead(file, waypoint.racing.shortestDistanceToEnd); + } else if (path.pathType == PathType::Rail) { + if (path.pathVersion > 16) BinaryIO::BinaryRead(file, waypoint.rail.speed); } // object LDF configs @@ -529,7 +531,7 @@ void Zone::LoadPath(std::istream& file) { } LDFBaseData* ldfConfig = nullptr; - if (path.pathType == PathType::Movement) { + if (path.pathType == PathType::Movement || path.pathType == PathType::Rail) { ldfConfig = LDFBaseData::DataFromString(parameter + "=0:" + value); } else { ldfConfig = LDFBaseData::DataFromString(parameter + "=" + value); diff --git a/dZoneManager/Zone.h b/dZoneManager/Zone.h index 0e7ae5eb..978438aa 100644 --- a/dZoneManager/Zone.h +++ b/dZoneManager/Zone.h @@ -75,7 +75,6 @@ struct RacingPathWaypoint { struct RailPathWaypoint { float speed; - std::vector config; }; struct PathWaypoint {