From 1f6622fce3a71cd8418374c08ca176b8f191431c Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Sun, 11 Sep 2022 13:32:19 +0200 Subject: [PATCH] Use defines --- src/client/component/fastfiles.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/component/fastfiles.cpp b/src/client/component/fastfiles.cpp index 51808b53..90804fd4 100644 --- a/src/client/component/fastfiles.cpp +++ b/src/client/component/fastfiles.cpp @@ -220,17 +220,18 @@ namespace fastfiles if (utils::io::file_exists(path)) { - return CreateFileA(path, 0x80000000, 1u, 0, 3u, 0x60000000u, 0); + return CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, nullptr); } } - return reinterpret_cast(-1); + return INVALID_HANDLE_VALUE; } if (name.ends_with(".ff")) { const auto handle = find_fastfile(name, true); - if (handle != reinterpret_cast(-1)) + if (handle != INVALID_HANDLE_VALUE) { return handle; } @@ -303,7 +304,7 @@ namespace fastfiles const auto handle = game::Sys_CreateFile((is_localized ? game::SF_ZONE_LOC : game::SF_ZONE), utils::string::va("%s.ff", zone.data())); - if (handle != reinterpret_cast(-1)) + if (handle != INVALID_HANDLE_VALUE) { CloseHandle(handle); return true;