mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-20 21:16:41 +00:00
Merge branch 'fix_msvc_warnings' into 'master'
Fix msvc warnings See merge request OpenMW/openmw!4829
This commit is contained in:
commit
0c4da49c74
2 changed files with 10 additions and 11 deletions
|
@ -59,14 +59,13 @@ namespace CSMWorld
|
||||||
|
|
||||||
const Record<ESM::LandTexture>* IdCollection<ESM::LandTexture>::searchRecord(std::uint16_t index, int plugin) const
|
const Record<ESM::LandTexture>* IdCollection<ESM::LandTexture>::searchRecord(std::uint16_t index, int plugin) const
|
||||||
{
|
{
|
||||||
auto found = mIndices.find({ plugin, index });
|
const auto it = mIndices.find({ plugin, index });
|
||||||
if (found != mIndices.end())
|
if (it == mIndices.end())
|
||||||
{
|
return nullptr;
|
||||||
int index = searchId(found->second);
|
const int recordIndex = searchId(it->second);
|
||||||
if (index != -1)
|
if (recordIndex == -1)
|
||||||
return &getRecord(index);
|
return nullptr;
|
||||||
}
|
return &getRecord(recordIndex);
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string* IdCollection<ESM::LandTexture>::getLandTexture(std::uint16_t index, int plugin) const
|
const std::string* IdCollection<ESM::LandTexture>::getLandTexture(std::uint16_t index, int plugin) const
|
||||||
|
|
|
@ -604,7 +604,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
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();
|
runtime.pop();
|
||||||
|
|
||||||
if (!ptr.getClass().isActor())
|
if (!ptr.getClass().isActor())
|
||||||
|
@ -615,11 +615,11 @@ namespace MWScript
|
||||||
|
|
||||||
long key;
|
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)
|
k.has_value() && *k >= 0 && *k <= 32767)
|
||||||
key = *k;
|
key = *k;
|
||||||
else
|
else
|
||||||
key = ESM::MagicEffect::effectGmstIdToIndex(effect);
|
key = ESM::MagicEffect::effectGmstIdToIndex(effectName);
|
||||||
|
|
||||||
const MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
|
const MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
|
||||||
for (const auto& spell : stats.getActiveSpells())
|
for (const auto& spell : stats.getActiveSpells())
|
||||||
|
|
Loading…
Reference in a new issue