1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-17 22:16:38 +00:00

Merge branch 'fix_msvc_warnings' into 'master'

Fix msvc warnings

See merge request OpenMW/openmw!4829
This commit is contained in:
Evil Eye 2025-08-04 14:56:59 +00:00
commit 0c4da49c74
2 changed files with 10 additions and 11 deletions

View file

@ -59,14 +59,13 @@ namespace CSMWorld
const Record<ESM::LandTexture>* IdCollection<ESM::LandTexture>::searchRecord(std::uint16_t index, int plugin) const
{
auto found = mIndices.find({ plugin, index });
if (found != mIndices.end())
{
int index = searchId(found->second);
if (index != -1)
return &getRecord(index);
}
return nullptr;
const auto it = mIndices.find({ plugin, index });
if (it == mIndices.end())
return nullptr;
const int recordIndex = searchId(it->second);
if (recordIndex == -1)
return nullptr;
return &getRecord(recordIndex);
}
const std::string* IdCollection<ESM::LandTexture>::getLandTexture(std::uint16_t index, int plugin) const

View file

@ -604,7 +604,7 @@ namespace MWScript
{
MWWorld::Ptr ptr = R()(runtime);
std::string_view effect = runtime.getStringLiteral(runtime[0].mInteger);
const std::string_view effectName = runtime.getStringLiteral(runtime[0].mInteger);
runtime.pop();
if (!ptr.getClass().isActor())
@ -615,11 +615,11 @@ namespace MWScript
long key;
if (const auto k = ::Misc::StringUtils::toNumeric<long>(effect);
if (const auto k = ::Misc::StringUtils::toNumeric<long>(effectName);
k.has_value() && *k >= 0 && *k <= 32767)
key = *k;
else
key = ESM::MagicEffect::effectGmstIdToIndex(effect);
key = ESM::MagicEffect::effectGmstIdToIndex(effectName);
const MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
for (const auto& spell : stats.getActiveSpells())