Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #9433: Use world generation seed from openttd.cfg if provided #9435

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/genworld.cpp
Expand Up @@ -93,7 +93,9 @@ static void _GenerateWorld()
_generating_world = true;
if (_network_dedicated) Debug(net, 3, "Generating map, please wait...");
/* Set the Random() seed to generation_seed so we produce the same map with the same seed */
if (_settings_game.game_creation.generation_seed == GENERATE_NEW_SEED) _settings_game.game_creation.generation_seed = _settings_newgame.game_creation.generation_seed = InteractiveRandom();
if (_settings_game.game_creation.generation_seed == GENERATE_NEW_SEED) {
_settings_game.game_creation.generation_seed = InteractiveRandom();
}
_random.SetSeed(_settings_game.game_creation.generation_seed);
SetGeneratingWorldProgress(GWP_MAP_INIT, 2);
SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, HT_NONE, WC_MAIN_WINDOW, 0);
Expand Down
3 changes: 0 additions & 3 deletions src/genworld_gui.cpp
Expand Up @@ -976,9 +976,6 @@ static void _ShowGenerateLandscape(GenerateLandscapeWindowMode mode)

CloseWindowByClass(WC_GENERATE_LANDSCAPE);

/* Generate a new seed when opening the window */
_settings_newgame.game_creation.generation_seed = InteractiveRandom();

if (mode == GLWM_HEIGHTMAP) {
/* If the function returns negative, it means there was a problem loading the heightmap */
if (!GetHeightmapDimensions(_file_to_saveload.detail_ftype, _file_to_saveload.name.c_str(), &x, &y)) return;
Expand Down