diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp index 4e165d6526..3aa5544b74 100644 --- a/apps/openmw/mwclass/misc.cpp +++ b/apps/openmw/mwclass/misc.cpp @@ -203,9 +203,9 @@ namespace MWClass std::unique_ptr Miscellaneous::use (const MWWorld::Ptr& ptr, bool force) const { - const char soulgem_prefix[] = "misc_soulgem"; + const std::string soulgemPrefix = "misc_soulgem"; - if (::Misc::StringUtils::ciCompareLen(ptr.getCellRef().getRefId(), soulgem_prefix, sizeof(soulgem_prefix) - 1) == 0) + if (::Misc::StringUtils::ciCompareLen(ptr.getCellRef().getRefId(), soulgemPrefix, soulgemPrefix.length()) == 0) return std::make_unique(ptr); return std::make_unique(); diff --git a/apps/openmw/mwscript/containerextensions.cpp b/apps/openmw/mwscript/containerextensions.cpp index 1bbaa9b60f..8699d3dfe4 100644 --- a/apps/openmw/mwscript/containerextensions.cpp +++ b/apps/openmw/mwscript/containerextensions.cpp @@ -307,9 +307,9 @@ namespace MWScript // With soul gems we prefer filled ones. - const char soulgem_prefix[] = "misc_soulgem"; + const std::string soulgemPrefix = "misc_soulgem"; - if (::Misc::StringUtils::ciCompareLen(item, soulgem_prefix, sizeof(soulgem_prefix) - 1) == 0) + if (::Misc::StringUtils::ciCompareLen(item, soulgemPrefix, soulgemPrefix.length()) == 0) { it = invStore.end(); diff --git a/apps/openmw/mwworld/actionsoulgem.cpp b/apps/openmw/mwworld/actionsoulgem.cpp index 72efa6d4ec..b416581fa7 100644 --- a/apps/openmw/mwworld/actionsoulgem.cpp +++ b/apps/openmw/mwworld/actionsoulgem.cpp @@ -30,7 +30,7 @@ namespace MWWorld } const auto& target = getTarget(); - const auto& targetSoul = target.getCellRef().getSoul(); + const std::string targetSoul = target.getCellRef().getSoul(); if (targetSoul.empty()) { @@ -40,9 +40,7 @@ namespace MWWorld if (!MWBase::Environment::get().getWorld()->getStore().get().search(targetSoul)) { - const auto& message = "Unknown soul creature id \"" + targetSoul + "\"."; - Log(Debug::Warning) << message; - MWBase::Environment::get().getWindowManager()->messageBox(message); + Log(Debug::Warning) << "Soul '" << targetSoul << "' not found (item: '" << target.getCellRef().getRefId() << "')"; return; }