mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-18 17:07:37 -04:00
Fix msvc warnings
openmw\apps\opencs\model\world\idcollection.cpp(65): warning C4457: declaration of 'index' hides function parameter openmw\apps\openmw\mwscript\miscextensions.cpp(627): warning C4456: declaration of 'effect' hides previous local declaration
This commit is contained in:
parent
b9a28dab3e
commit
555a10f50c
@ -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
|
||||
|
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user