mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-19 01:16:45 -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
|
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…
x
Reference in New Issue
Block a user