1
0
forked from 0ad/0ad

Fix: Crash atlas in relation to Terrain.cpp CalcPosition

Patch by: @trompetin17
Differential revision: https://code.wildfiregames.com/D4900
Comments by: @Langbart, @Stan, @Vladislav
Fixes #6550

This was SVN commit r27499.
This commit is contained in:
trompetin17 2023-01-28 22:42:00 +00:00
parent cb5a0b6342
commit 5d7a8b9d1b

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2023 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -718,6 +718,11 @@ void MapSidebar::OnRandomGenerate(wxCommandEvent& WXUNUSED(evt))
// Copy the old map settings, so we don't lose them if the map generation fails
AtObj oldSettings = settings;
// Deactivate tools, so they don't carry forwards into the new CWorld
// and crash.
m_ScenarioEditor.GetToolManager().SetCurrentTool(_T(""));
// TODO: clear the undo buffer, etc
AtlasMessage::qGenerateMap qry((std::wstring)scriptName.wc_str(), json);
qry.Post();
@ -729,6 +734,8 @@ void MapSidebar::OnRandomGenerate(wxCommandEvent& WXUNUSED(evt))
}
m_ScenarioEditor.NotifyOnMapReload();
m_ScenarioEditor.GetCommandProc().ClearCommands();
}
void MapSidebar::OnOpenPlayerPanel(wxCommandEvent& WXUNUSED(evt))