mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-17 10:21:11 +00:00
Merge branch 'fix_noexcept_default' into 'master'
Fix build by compliers without implementation of P1286R2 (#5983) See merge request OpenMW/openmw!772
This commit is contained in:
commit
6420501baa
@ -60,7 +60,7 @@ namespace MWClass
|
|||||||
|
|
||||||
CreatureCustomData() = default;
|
CreatureCustomData() = default;
|
||||||
CreatureCustomData(const CreatureCustomData& other);
|
CreatureCustomData(const CreatureCustomData& other);
|
||||||
CreatureCustomData(CreatureCustomData&& other) noexcept = default;
|
CreatureCustomData(CreatureCustomData&& other) = default;
|
||||||
|
|
||||||
CreatureCustomData& asCreatureCustomData() override
|
CreatureCustomData& asCreatureCustomData() override
|
||||||
{
|
{
|
||||||
|
@ -153,23 +153,23 @@ namespace MWMechanics
|
|||||||
|
|
||||||
void SpellList::addListener(Spells* spells)
|
void SpellList::addListener(Spells* spells)
|
||||||
{
|
{
|
||||||
for(const auto ptr : mListeners)
|
if (std::find(mListeners.begin(), mListeners.end(), spells) != mListeners.end())
|
||||||
{
|
return;
|
||||||
if(ptr == spells)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mListeners.push_back(spells);
|
mListeners.push_back(spells);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellList::removeListener(Spells* spells)
|
void SpellList::removeListener(Spells* spells)
|
||||||
{
|
{
|
||||||
for(auto it = mListeners.begin(); it != mListeners.end(); it++)
|
const auto it = std::find(mListeners.begin(), mListeners.end(), spells);
|
||||||
{
|
if (it != mListeners.end())
|
||||||
if(*it == spells)
|
mListeners.erase(it);
|
||||||
{
|
}
|
||||||
mListeners.erase(it);
|
|
||||||
break;
|
void SpellList::updateListener(Spells* before, Spells* after)
|
||||||
}
|
{
|
||||||
}
|
const auto it = std::find(mListeners.begin(), mListeners.end(), before);
|
||||||
|
if (it == mListeners.end())
|
||||||
|
return mListeners.push_back(after);
|
||||||
|
*it = after;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@ namespace MWMechanics
|
|||||||
|
|
||||||
void removeListener(Spells* spells);
|
void removeListener(Spells* spells);
|
||||||
|
|
||||||
|
void updateListener(Spells* before, Spells* after);
|
||||||
|
|
||||||
const std::vector<std::string> getSpells() const;
|
const std::vector<std::string> getSpells() const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,15 @@ namespace MWMechanics
|
|||||||
mSpellList->addListener(this);
|
mSpellList->addListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Spells::Spells(Spells&& spells) : mSpellList(std::move(spells.mSpellList)), mSpells(std::move(spells.mSpells)),
|
||||||
|
mSelectedSpell(std::move(spells.mSelectedSpell)), mUsedPowers(std::move(spells.mUsedPowers)),
|
||||||
|
mSpellsChanged(std::move(spells.mSpellsChanged)), mEffects(std::move(spells.mEffects)),
|
||||||
|
mSourcedEffects(std::move(spells.mSourcedEffects))
|
||||||
|
{
|
||||||
|
if (mSpellList)
|
||||||
|
mSpellList->updateListener(&spells, this);
|
||||||
|
}
|
||||||
|
|
||||||
std::map<const ESM::Spell*, SpellParams>::const_iterator Spells::begin() const
|
std::map<const ESM::Spell*, SpellParams>::const_iterator Spells::begin() const
|
||||||
{
|
{
|
||||||
return mSpells.begin();
|
return mSpells.begin();
|
||||||
|
@ -59,7 +59,7 @@ namespace MWMechanics
|
|||||||
|
|
||||||
Spells(const Spells&);
|
Spells(const Spells&);
|
||||||
|
|
||||||
Spells(const Spells&&) = delete;
|
Spells(Spells&& spells);
|
||||||
|
|
||||||
~Spells();
|
~Spells();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user