1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Merge pull request #4778 from Laserlicht/assert_fix

fix: workaround for assert
This commit is contained in:
Ivan Savenko 2024-10-15 18:01:31 +03:00 committed by GitHub
commit e676e78e28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,7 +107,7 @@ void TextLocalizationContainer::registerString(const std::string & identifierMod
assert(!identifierModContext.empty()); assert(!identifierModContext.empty());
assert(!localizedStringModContext.empty()); assert(!localizedStringModContext.empty());
assert(UID.get().find("..") == std::string::npos); // invalid identifier - there is section that was evaluated to empty string assert(UID.get().find("..") == std::string::npos); // invalid identifier - there is section that was evaluated to empty string
assert(stringsLocalizations.count(UID.get()) == 0 || boost::algorithm::starts_with(UID.get(), "map")); // registering already registered string? assert(stringsLocalizations.count(UID.get()) == 0 || boost::algorithm::starts_with(UID.get(), "map") || boost::algorithm::starts_with(UID.get(), "header")); // registering already registered string? FIXME: "header" is a workaround. VMAP needs proper integration in translation system
if(stringsLocalizations.count(UID.get()) > 0) if(stringsLocalizations.count(UID.get()) > 0)
{ {