mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
use std::string, no unlocalized message, show soul gem id
This commit is contained in:
parent
3698d96b46
commit
782cb7699d
@ -203,9 +203,9 @@ namespace MWClass
|
||||
|
||||
std::unique_ptr<MWWorld::Action> 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<MWWorld::ActionSoulgem>(ptr);
|
||||
|
||||
return std::make_unique<MWWorld::NullAction>();
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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<ESM::Creature>().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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user