mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #4204: Client trying to get sprite 65535
Caused by a conflict between a multiplayer map download and the title loading a different map.
This commit is contained in:
parent
c3fdb99ceb
commit
53a7b87414
10
src/game.c
10
src/game.c
|
@ -806,13 +806,13 @@ bool game_load_save(const utf8 *path)
|
||||||
SDL_RWclose(rw);
|
SDL_RWclose(rw);
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
|
if (network_get_mode() == NETWORK_MODE_CLIENT) {
|
||||||
|
network_close();
|
||||||
|
}
|
||||||
game_load_init();
|
game_load_init();
|
||||||
if (network_get_mode() == NETWORK_MODE_SERVER) {
|
if (network_get_mode() == NETWORK_MODE_SERVER) {
|
||||||
network_send_map();
|
network_send_map();
|
||||||
}
|
}
|
||||||
if (network_get_mode() == NETWORK_MODE_CLIENT) {
|
|
||||||
network_close();
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// If loading the SV6 or SV4 failed, the current park state will be corrupted
|
// If loading the SV6 or SV4 failed, the current park state will be corrupted
|
||||||
|
@ -851,6 +851,10 @@ void game_load_init()
|
||||||
mainWindow->saved_view_y -= mainWindow->viewport->view_height >> 1;
|
mainWindow->saved_view_y -= mainWindow->viewport->view_height >> 1;
|
||||||
window_invalidate(mainWindow);
|
window_invalidate(mainWindow);
|
||||||
|
|
||||||
|
if (network_get_mode() != NETWORK_MODE_CLIENT)
|
||||||
|
{
|
||||||
|
reset_sprite_spatial_index();
|
||||||
|
}
|
||||||
reset_all_sprite_quadrant_placements();
|
reset_all_sprite_quadrant_placements();
|
||||||
scenery_set_default_placement_configuration();
|
scenery_set_default_placement_configuration();
|
||||||
window_new_ride_init_vars();
|
window_new_ride_init_vars();
|
||||||
|
|
|
@ -366,11 +366,6 @@ void S6Importer::Import()
|
||||||
throw ObjectLoadException();
|
throw ObjectLoadException();
|
||||||
}
|
}
|
||||||
map_update_tile_pointers();
|
map_update_tile_pointers();
|
||||||
reset_all_sprite_quadrant_placements();
|
|
||||||
if (network_get_mode() != NETWORK_MODE_CLIENT)
|
|
||||||
{
|
|
||||||
reset_sprite_spatial_index();
|
|
||||||
}
|
|
||||||
game_convert_strings_to_utf8();
|
game_convert_strings_to_utf8();
|
||||||
if (FixIssues)
|
if (FixIssues)
|
||||||
{
|
{
|
||||||
|
|
|
@ -119,6 +119,9 @@ int scenario_load_and_play_from_path(const char *path)
|
||||||
if (!scenario_load(path))
|
if (!scenario_load(path))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
reset_sprite_spatial_index();
|
||||||
|
reset_all_sprite_quadrant_placements();
|
||||||
|
|
||||||
int len = strnlen(path, MAX_PATH) + 1;
|
int len = strnlen(path, MAX_PATH) + 1;
|
||||||
safe_strcpy(_scenarioPath, path, len);
|
safe_strcpy(_scenarioPath, path, len);
|
||||||
if (len - 1 == MAX_PATH)
|
if (len - 1 == MAX_PATH)
|
||||||
|
|
|
@ -209,6 +209,7 @@ static int title_load_park(const char *path)
|
||||||
}
|
}
|
||||||
|
|
||||||
window_invalidate(w);
|
window_invalidate(w);
|
||||||
|
reset_sprite_spatial_index();
|
||||||
reset_all_sprite_quadrant_placements();
|
reset_all_sprite_quadrant_placements();
|
||||||
window_new_ride_init_vars();
|
window_new_ride_init_vars();
|
||||||
if (_strcmpi(path_get_extension(path), ".sv6") != 0)
|
if (_strcmpi(path_get_extension(path), ".sv6") != 0)
|
||||||
|
|
Loading…
Reference in New Issue