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
This commit is contained in:
Aaron Kimbrell 2022-11-14 13:57:49 -06:00 committed by GitHub
parent 37524af549
commit 3fa6ea4cea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

@ -75,7 +75,6 @@ struct RacingPathWaypoint {
struct RailPathWaypoint {
float speed;
std::vector<LDFBaseData*> config;
};
struct PathWaypoint {