1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

Merge remote-tracking branch 'upstream/develop' into new-save-format

This commit is contained in:
Gymnasiast
2021-07-27 20:33:33 +02:00
6 changed files with 17 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
0.3.4.1+ (in development)
------------------------------------------------------------------------
- Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner.
- Improved: [#3417] Crash dumps are now placed in their own folder.
0.3.4.1 (2021-07-25)
------------------------------------------------------------------------

View File

@@ -1134,6 +1134,7 @@ namespace OpenRCT2
DIRID::SEQUENCE,
DIRID::REPLAY,
DIRID::LOG_DESYNCS,
DIRID::CRASH,
});
}

View File

@@ -228,6 +228,7 @@ const char * PlatformEnvironment::DirectoryNamesOpenRCT2[] =
"heightmap", // HEIGHTMAP
"replay", // REPLAY
"desyncs", // DESYNCS
"crash", // CRASH
};
const char * PlatformEnvironment::FileNames[] =

View File

@@ -49,6 +49,7 @@ namespace OpenRCT2
HEIGHTMAP, // Contains heightmap data.
REPLAY, // Contains recorded replays.
LOG_DESYNCS, // Contains desync reports.
CRASH, // Contains crash dumps.
};
enum class PATHID

View File

@@ -28,10 +28,12 @@
# include "../Game.h"
# include "../OpenRCT2.h"
# include "../ParkFile.h"
# include "../PlatformEnvironment.h"
# include "../Version.h"
# include "../config/Config.h"
# include "../core/Console.hpp"
# include "../core/Guard.hpp"
# include "../core/Path.hpp"
# include "../core/String.hpp"
# include "../interface/Screenshot.h"
# include "../localisation/Language.h"
@@ -54,6 +56,8 @@ const wchar_t* _wszArchitecture = WSZ(OPENRCT2_ARCHITECTURE);
# define BACKTRACE_TOKEN L"742b8d9d70c52df663e4f2449f90039cf9406f89e57ecb90b0f086ba16e33d20"
using namespace OpenRCT2;
// Note: uploading gzipped crash dumps manually requires specifying
// 'Content-Encoding: gzip' header in HTTP request, but we cannot do that,
// so just hope the file name with '.gz' suffix is enough.
@@ -69,6 +73,7 @@ static bool UploadMinidump(const std::map<std::wstring, std::wstring>& files, in
L"post?format=minidump&token=" BACKTRACE_TOKEN);
std::map<std::wstring, std::wstring> parameters;
parameters[L"product_name"] = L"openrct2";
parameters[L"version"] = String::ToWideChar(gVersionInfoFull);
// In case of releases this can be empty
if (wcslen(_wszCommitSha1Short) > 0)
{
@@ -302,9 +307,10 @@ static bool OnCrash(
static std::wstring GetDumpDirectory()
{
char userDirectory[MAX_PATH];
platform_get_user_directory(userDirectory, nullptr, sizeof(userDirectory));
auto result = String::ToWideChar(userDirectory);
auto env = GetContext()->GetPlatformEnvironment();
auto crashPath = env->GetDirectoryPath(DIRBASE::OPENRCT2, DIRID::CRASH);
auto result = String::ToWideChar(crashPath.c_str());
return result;
}

View File

@@ -406,7 +406,10 @@ Banner* GetOrCreateBanner(BannerIndex id)
{
_banners.resize(id + 1);
}
return &_banners[id];
// Create the banner
auto& banner = _banners[id];
banner.id = id;
return &banner;
}
return nullptr;
}