forked from rosebudai/OpenRCT2-Web
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:
1 parent
af91b9f4b4
commit
f47d7f27a5
1 file changed
+10
-11
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user