Skip to content

Instantly share code, notes, and snippets.

@Wolfolo
Last active August 25, 2017 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wolfolo/d1f29f0534aa4485463e6a406d9dad38 to your computer and use it in GitHub Desktop.
Save Wolfolo/d1f29f0534aa4485463e6a406d9dad38 to your computer and use it in GitHub Desktop.
diff --git a/src/genworld.cpp b/src/genworld.cpp
index 5cdb129..703277e 100644
--- a/src/genworld.cpp
+++ b/src/genworld.cpp
@@ -103,7 +103,7 @@ static void _GenerateWorld(void *)
_modal_progress_work_mutex->BeginCritical();
if (_network_dedicated) DEBUG(net, 1, "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);
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 359709e..441612e 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -264,10 +264,6 @@ static void StartGeneratingLandscape(GenerateLandscapeWindowMode mode)
DeleteAllNonVitalWindows();
ClearErrorMessages();
- /* Copy all XXX_newgame to XXX when coming from outside the editor */
- MakeNewgameSettingsLive();
- ResetGRFConfig(true);
-
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
switch (mode) {
case GLWM_GENERATE: _switch_mode = (_game_mode == GM_EDITOR) ? SM_GENRANDLAND : SM_NEWGAME; break;
@@ -829,7 +825,7 @@ static void _ShowGenerateLandscape(GenerateLandscapeWindowMode mode)
DeleteWindowByClass(WC_GENERATE_LANDSCAPE);
/* Generate a new seed when opening the window */
- _settings_newgame.game_creation.generation_seed = InteractiveRandom();
+ _settings_game.game_creation.generation_seed = GENERATE_NEW_SEED; //InteractiveRandom();
if (mode == GLWM_HEIGHTMAP) {
/* If the function returns negative, it means there was a problem loading the heightmap */
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 10c31e9..b359365 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -981,6 +981,8 @@ static void MakeNewEditorWorld()
{
_game_mode = GM_EDITOR;
+ /* Copy the new game settings when switching to the editor */
+ MakeNewgameSettingsLive();
ResetGRFConfig(true);
GenerateWorldSetCallback(&MakeNewEditorWorldDone);
@@ -1172,7 +1174,7 @@ void SwitchToMode(SwitchMode new_mode)
case SM_GENRANDLAND: // Generate random land within scenario editor
SetLocalCompany(OWNER_NONE);
- GenerateWorld(GWM_RANDOM, 1 << _settings_game.game_creation.map_x, 1 << _settings_game.game_creation.map_y);
+ GenerateWorld(GWM_RANDOM, 1 << _settings_game.game_creation.map_x, 1 << _settings_game.game_creation.map_y, false);
/* XXX: set date */
MarkWholeScreenDirty();
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment