Skip to content

Commit

Permalink
inform facegen excludes
Browse files Browse the repository at this point in the history
  • Loading branch information
Perchik71 committed Sep 30, 2024
1 parent d4a59ba commit af4a54a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions source/xc_patch_facegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@

namespace xc
{
inline static const string& trim(const string& str)
{
static const char* whitespaceDelimiters = " \t\n\r\f\v";

const_cast<string&>(str).erase(str.find_last_not_of(whitespaceDelimiters) + 1);
const_cast<string&>(str).erase(0, str.find_first_not_of(whitespaceDelimiters));

return str;
}

BGSKeyword** g_keyword_is_child_player = nullptr;
vector<UInt32> g_facegen_primary_exception_formids =
{
Expand Down Expand Up @@ -57,11 +67,11 @@ namespace xc
auto it_sep = it->second.find_first_of(':');
if (it_sep != std::string::npos)
{
plugin_name = it->second.substr(it_sep + 1);
value = it->second.substr(0, it_sep);
plugin_name = trim(it->second.substr(it_sep + 1));
value = trim(it->second.substr(0, it_sep));
}
else
value = it->second;
value = trim(it->second);

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

//_MESSAGE("Skip NPC added \"%s\" (%08X)", it->first.c_str(), formid);
_MESSAGE("Skip NPC added \"%s\" (%08X)", it->first.c_str(), formid);
g_facegen_exception_formids.push_back(formid);
}
}
Expand Down
Binary file modified version/build_version.txt
Binary file not shown.
Binary file modified version/resource_version2.h
Binary file not shown.

0 comments on commit af4a54a

Please sign in to comment.