1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Suppress hotkey.cfg error if not found

Running the game without hotkeys.cfg existing used to show a warning message. This is unnecessary as it will not exist on first install.
This commit is contained in:
Ted John
2017-06-03 22:17:52 +01:00
parent af91b9f4b4
commit f47d7f27a5

View File

@@ -16,6 +16,7 @@
#include "../common.h"
#include "../core/Console.hpp"
#include "../core/File.h"
#include "../core/FileStream.hpp"
#include "../core/Memory.hpp"
#include "../core/Path.hpp"
@@ -128,20 +129,18 @@ extern "C"
try
{
std::string path = KeyboardShortcuts::GetPath();
auto fs = FileStream(path, FILE_MODE_OPEN);
uint16 version = fs.ReadValue<uint16>();
if (version == KeyboardShortcuts::CURRENT_FILE_VERSION)
if (File::Exists(path))
{
for (sint32 i = 0; i < SHORTCUT_COUNT; i++)
auto fs = FileStream(path, FILE_MODE_OPEN);
uint16 version = fs.ReadValue<uint16>();
if (version == KeyboardShortcuts::CURRENT_FILE_VERSION)
{
gShortcutKeys[i] = fs.ReadValue<uint16>();
for (sint32 i = 0; i < SHORTCUT_COUNT; i++)
{
gShortcutKeys[i] = fs.ReadValue<uint16>();
}
result = true;
}
result = true;
}
else
{
result = false;
}
}
catch (const Exception &ex)