Fix #5471: Ride name issues at ride construction time

This commit is contained in:
Richard Jenkins 2017-05-16 20:56:20 +01:00 committed by Michael Steenbeek
parent b9dc588da4
commit 6d32c38fb3
2 changed files with 3 additions and 5 deletions

View File

@ -56,7 +56,7 @@ extern "C" {
// This define specifies which version of network stream current build uses. // This define specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within // It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version. // single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "5" #define NETWORK_STREAM_VERSION "6"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -5773,14 +5773,12 @@ static bool ride_name_exists(char *name)
char buffer[256]; char buffer[256];
rct_ride *ride; rct_ride *ride;
sint32 i; sint32 i;
FOR_ALL_RIDES(i, ride) { FOR_ALL_RIDES(i, ride) {
format_string(buffer, 256, ride->name, &ride->name_arguments); format_string(buffer, 256, ride->name, &ride->name_arguments);
if (strcmp(buffer, name) == 0) { if ((strcmp(buffer, name) == 0) && ride_has_any_track_elements(i)) {
return true; return true;
} }
} }
return false; return false;
} }
@ -6000,7 +5998,7 @@ foundRideEntry:
ride->name = 1; ride->name = 1;
ride->name_arguments_type_name = rideEntry->name; ride->name_arguments_type_name = rideEntry->name;
rct_string_id rideNameStringId = 0; rct_string_id rideNameStringId = 0;
name_args.type_name = 2 + ride->type; name_args.type_name = rideEntry->name;
name_args.number = 0; name_args.number = 0;
do { do {