From af4a54a382ca6a59cd72bb334db47fa6eb4a255e Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 30 Sep 2024 22:03:47 +0300 Subject: [PATCH] inform facegen excludes --- source/xc_patch_facegen.cpp | 24 +++++++++++++++++++----- version/build_version.txt | Bin 10 -> 10 bytes version/resource_version2.h | Bin 2002 -> 2002 bytes 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/source/xc_patch_facegen.cpp b/source/xc_patch_facegen.cpp index d659695..a83aadf 100644 --- a/source/xc_patch_facegen.cpp +++ b/source/xc_patch_facegen.cpp @@ -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(str).erase(str.find_last_not_of(whitespaceDelimiters) + 1); + const_cast(str).erase(0, str.find_first_not_of(whitespaceDelimiters)); + + return str; + } + BGSKeyword** g_keyword_is_child_player = nullptr; vector g_facegen_primary_exception_formids = { @@ -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); @@ -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); } } diff --git a/version/build_version.txt b/version/build_version.txt index 33cd77a456d9cbe7b473c5290fb742cb9c2f5dcc..355f6f25a46baa91102398fd3684a01efe48e0d5 100644 GIT binary patch literal 10 RcmezW&z!-6ftP`c0RR?00)zkn literal 10 RcmezW&z!-CftP`c0RR>n0)7Ah diff --git a/version/resource_version2.h b/version/resource_version2.h index 6935331750730b635b239bf18540d05b0fd9a975..d1b2d0909560869471a72f66353fd3c959bf13ee 100644 GIT binary patch delta 14 Wcmcb_e~Ev?17=3^%@3JBG6MiF