Skip to content

Commit af4a54a

Browse files
committed
inform facegen excludes
1 parent d4a59ba commit af4a54a

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

source/xc_patch_facegen.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515

1616
namespace xc
1717
{
18+
inline static const string& trim(const string& str)
19+
{
20+
static const char* whitespaceDelimiters = " \t\n\r\f\v";
21+
22+
const_cast<string&>(str).erase(str.find_last_not_of(whitespaceDelimiters) + 1);
23+
const_cast<string&>(str).erase(0, str.find_first_not_of(whitespaceDelimiters));
24+
25+
return str;
26+
}
27+
1828
BGSKeyword** g_keyword_is_child_player = nullptr;
1929
vector<UInt32> g_facegen_primary_exception_formids =
2030
{
@@ -57,11 +67,11 @@ namespace xc
5767
auto it_sep = it->second.find_first_of(':');
5868
if (it_sep != std::string::npos)
5969
{
60-
plugin_name = it->second.substr(it_sep + 1);
61-
value = it->second.substr(0, it_sep);
70+
plugin_name = trim(it->second.substr(it_sep + 1));
71+
value = trim(it->second.substr(0, it_sep));
6272
}
6373
else
64-
value = it->second;
74+
value = trim(it->second);
6575

6676
if (value.find_first_of("0x") == 0)
6777
formid = strtoul(it->second.c_str() + 2, &end_ptr, 16);
@@ -78,10 +88,14 @@ namespace xc
7888
else if ((index_plugin = dataHandler->GetLoadedLightModIndex(plugin_name.c_str())) != INVALID_INDEX)
7989
formid = (formid & (0x00000FFF)) | (index_plugin << 12) | 0xFE000000;
8090
// If there is no such thing, then it is a waste of a stupid user's time
81-
else continue;
91+
else
92+
{
93+
_MESSAGE("Failed NPC added (no found plugin) \"%s\" (%08X)", plugin_name, formid);
94+
continue;
95+
}
8296
}
8397

84-
//_MESSAGE("Skip NPC added \"%s\" (%08X)", it->first.c_str(), formid);
98+
_MESSAGE("Skip NPC added \"%s\" (%08X)", it->first.c_str(), formid);
8599
g_facegen_exception_formids.push_back(formid);
86100
}
87101
}

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)