Skip to content

Commit d5cf513

Browse files
committed
Only absolute paths
1 parent 231712e commit d5cf513

File tree

6 files changed

+9
-18
lines changed

6 files changed

+9
-18
lines changed

X-Cell-FO4.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
<GenerateDebugInformation>false</GenerateDebugInformation>
237237
<EnableUAC>false</EnableUAC>
238238
<AdditionalLibraryDirectories>$(SolutionDir)lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
239-
<AdditionalDependencies>common_vc22.lib;f4se_common.lib;detours.lib;vmm.lib;libdeflate.lib;%(AdditionalDependencies)</AdditionalDependencies>
239+
<AdditionalDependencies>common_vc22.lib;f4se_common.lib;detours.lib;vmm.lib;libdeflate.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
240240
</Link>
241241
<PreBuildEvent>
242242
<Command>powershell -ExecutionPolicy Bypass -File "$(SolutionDir)\version\scripts.ps1"</Command>

include/xc_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//#pragma comment(linker, "/BASE:0x13140000")
99

1010
#include <common/IPrefix.h>
11+
#include <shlwapi.h>
1112
#include <algorithm>
1213
#include <intrin.h>
1314

source/xc_patch_facegen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace xc
4343
formid = strtoul(it->second.c_str() + 2, &end_ptr, 16);
4444
else
4545
formid = strtoul(it->second.c_str(), &end_ptr, 10);
46-
46+
4747
// _MESSAGE("Skip NPC added \"%s\" (%08X)", it->first.c_str(), formid);
4848
g_facegen_exception_formids.push_back(formid);
4949
}

source/xc_patch_profile.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ namespace xc
4444

4545
mINI::INIStructure* impl_get_file(const char* lpFileName)
4646
{
47+
if(PathIsRelativeA(lpFileName)) return nullptr;
48+
4749
mINI::INIStructure* ini_data = nullptr;
4850

4951
auto iterator_find = _cache.find(lpFileName);
@@ -68,19 +70,14 @@ namespace xc
6870
unsigned int patch_profile::impl_get_private_profile_string(const char* app_name, const char* key_name, const char* default_value,
6971
char* returned_string, unsigned int size, const char* file_name)
7072
{
73+
//errno = 0;
74+
7175
if (!returned_string || !size)
7276
return 0;
7377

7478
auto ini_data = impl_get_file(file_name);
7579
if (!ini_data)
76-
{
77-
// In the event the initialization file specified by file_name is not found, or contains invalid values,
78-
// this function will set errorno with a value of '0x2' (File Not Found).
79-
// To retrieve extended error information, call GetLastError.
80-
_set_errno(0x2);
81-
82-
return 0;
83-
}
80+
return GetPrivateProfileStringA(app_name, key_name, default_value, returned_string, size, file_name);
8481

8582
string s;
8683
size_t l = 0;
@@ -145,14 +142,7 @@ namespace xc
145142

146143
auto ini_data = impl_get_file(file_name);
147144
if (!ini_data)
148-
{
149-
// In the event the initialization file specified by file_name is not found, or contains invalid values,
150-
// this function will set errorno with a value of '0x2' (File Not Found).
151-
// To retrieve extended error information, call GetLastError.
152-
_set_errno(0x2);
153-
154-
return default_value;
155-
}
145+
return GetPrivateProfileIntA(app_name, key_name, default_value, file_name);
156146

157147
string s;
158148
auto ip = ini_data->get(app_name);

version/build_version.txt

0 Bytes
Binary file not shown.

version/resource_version2.h

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)