clean up patch enable quest logic

This commit is contained in:
Martin Michelsen
2024-08-15 20:23:10 -07:00
parent 7d775a38d1
commit 4426476a15
24 changed files with 108 additions and 81 deletions
+1 -4
View File
@@ -459,15 +459,12 @@ bool Quest::has_version_any_language(Version v) const {
return ((it != this->versions.end()) && ((it->first & 0xFF00) == k));
}
shared_ptr<const VersionedQuest> Quest::version(Version v, uint8_t language, bool allow_language_fallback) const {
shared_ptr<const VersionedQuest> Quest::version(Version v, uint8_t language) const {
// Return the requested version, if it exists
try {
return this->versions.at(this->versions_key(v, language));
} catch (const out_of_range&) {
}
if (!allow_language_fallback) {
return nullptr;
}
// Return the English version, if it exists
try {