Enable boosters when loading vehicle

This commit is contained in:
Gymnasiast 2017-01-01 21:06:54 +01:00
parent 69ea33452b
commit f60148c374
1 changed files with 16 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include "../core/Util.hpp"
#include "ObjectRepository.h"
#include "RideObject.h"
#include "../ride/track.h"
extern "C"
{
@ -79,6 +80,21 @@ void RideObject::ReadLegacy(IReadObjectContext * context, IStream * stream)
if (gConfigInterface.select_by_track_type) {
_legacyType.enabledTrackPieces = 0xFFFFFFFFFFFFFFFF;
}
else
{
// When not in select by track type mode, add boosters if the track type is eligible
for (int i = 0; i < 3; i++) {
if (_legacyType.ride_type[i] == RIDE_TYPE_LOOPING_ROLLER_COASTER ||
_legacyType.ride_type[i] == RIDE_TYPE_CORKSCREW_ROLLER_COASTER ||
_legacyType.ride_type[i] == RIDE_TYPE_TWISTER_ROLLER_COASTER ||
_legacyType.ride_type[i] == RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER ||
_legacyType.ride_type[i] == RIDE_TYPE_GIGA_COASTER ||
_legacyType.ride_type[i] == RIDE_TYPE_JUNIOR_ROLLER_COASTER) {
_legacyType.enabledTrackPieces |= (1ULL << TRACK_BOOSTER);
}
}
}
GetStringTable()->Read(context, stream, OBJ_STRING_ID_CAPACITY);