1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:29:55 +00:00

Include creatures

This commit is contained in:
Evil Eye 2024-05-25 09:58:46 +02:00
parent cdfd305ac3
commit 11e8e1eeb5
2 changed files with 3 additions and 5 deletions

View file

@ -264,9 +264,7 @@ namespace
}
else if (state.mVersion <= ESM::MaxOldCreatureStatsFormatVersion)
{
if constexpr (std::is_same_v<T, ESM::Creature>)
MWWorld::convertStats(state.mCreatureStats);
else if constexpr (std::is_same_v<T, ESM::NPC>)
if constexpr (std::is_same_v<T, ESM::Creature> || std::is_same_v<T, ESM::NPC>)
{
MWWorld::convertStats(state.mCreatureStats);
MWWorld::convertEnchantmentSlots(state.mCreatureStats, state.mInventory);
@ -274,7 +272,7 @@ namespace
}
else if (state.mVersion <= ESM::MaxActiveSpellSlotIndexFormatVersion)
{
if constexpr (std::is_same_v<T, ESM::NPC>)
if constexpr (std::is_same_v<T, ESM::Creature> || std::is_same_v<T, ESM::NPC>)
MWWorld::convertEnchantmentSlots(state.mCreatureStats, state.mInventory);
}

View file

@ -243,7 +243,7 @@ namespace MWWorld
continue;
if (activeSpell.mFlags & ESM::ActiveSpells::Flag_Equipment)
{
auto slotIndex = activeSpell.mItem.mIndex;
std::int64_t slotIndex = activeSpell.mItem.mIndex;
auto slot = std::find_if(inventory.mEquipmentSlots.begin(), inventory.mEquipmentSlots.end(),
[=](const auto& entry) { return entry.second == slotIndex; });
if (slot != inventory.mEquipmentSlots.end() && slot->first < inventory.mItems.size())