diff options
Diffstat (limited to 'pokemod/Move.cpp')
| -rw-r--r-- | pokemod/Move.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pokemod/Move.cpp b/pokemod/Move.cpp index aaf6af7b..d91eda87 100644 --- a/pokemod/Move.cpp +++ b/pokemod/Move.cpp @@ -63,8 +63,8 @@ Move::Move(const Pokemod* pokemod, const QString& fileName, const int id) : Move::~Move() { - foreach (MoveEffect* effect, m_effects) - delete effect; + while (effectCount()) + deleteEffect(0); } bool Move::validate() const @@ -149,7 +149,8 @@ void Move::load(const QString& fileName, int id) throw(Exception) QStringList path = pokemod()->path().split('/'); path.removeLast(); QDir fdir(path.join("/")); - m_effects.clear(); + while (effectCount()) + deleteEffect(0); if (fdir.cd("effect")) { QStringList files(fdir.entryList(QStringList("*.pini"), QDir::Files, QDir::Name)); @@ -430,7 +431,8 @@ Move& Move::operator=(const Move& rhs) m_canSnatch = rhs.m_canSnatch; m_sound = rhs.m_sound; m_description = rhs.m_description; - m_effects.clear(); + while (effectCount()) + deleteEffect(0); foreach (MoveEffect* effect, rhs.m_effects) m_effects.append(new MoveEffect(pokemod(), *effect, effect->id())); return *this; |
