mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 04:45:32 +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
5 changed files with 26 additions and 15 deletions
|
@ -60,7 +60,7 @@ namespace MWClass
|
|||
|
||||
CreatureCustomData() = default;
|
||||
CreatureCustomData(const CreatureCustomData& other);
|
||||
CreatureCustomData(CreatureCustomData&& other) noexcept = default;
|
||||
CreatureCustomData(CreatureCustomData&& other) = default;
|
||||
|
||||
CreatureCustomData& asCreatureCustomData() override
|
||||
{
|
||||
|
|
|
@ -153,23 +153,23 @@ namespace MWMechanics
|
|||
|
||||
void SpellList::addListener(Spells* spells)
|
||||
{
|
||||
for(const auto ptr : mListeners)
|
||||
{
|
||||
if(ptr == spells)
|
||||
return;
|
||||
}
|
||||
if (std::find(mListeners.begin(), mListeners.end(), spells) != mListeners.end())
|
||||
return;
|
||||
mListeners.push_back(spells);
|
||||
}
|
||||
|
||||
void SpellList::removeListener(Spells* spells)
|
||||
{
|
||||
for(auto it = mListeners.begin(); it != mListeners.end(); it++)
|
||||
{
|
||||
if(*it == spells)
|
||||
{
|
||||
mListeners.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
const auto it = std::find(mListeners.begin(), mListeners.end(), spells);
|
||||
if (it != mListeners.end())
|
||||
mListeners.erase(it);
|
||||
}
|
||||
|
||||
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 updateListener(Spells* before, Spells* after);
|
||||
|
||||
const std::vector<std::string> getSpells() const;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -32,6 +32,15 @@ namespace MWMechanics
|
|||
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
|
||||
{
|
||||
return mSpells.begin();
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace MWMechanics
|
|||
|
||||
Spells(const Spells&);
|
||||
|
||||
Spells(const Spells&&) = delete;
|
||||
Spells(Spells&& spells);
|
||||
|
||||
~Spells();
|
||||
|
||||
|
|
Loading…
Reference in a new issue