diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-08-04 03:27:13 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-08-04 03:27:13 +0000 |
| commit | 373e686bf4ecaaabcf80544e74f017eebe05213f (patch) | |
| tree | cddf7a223f16944b0380386e568f2606f634c366 /pokemod/MapTrainerTeamMember.cpp | |
| parent | 63417b1c5057d22bd853e92cd3a25aa812b8d917 (diff) | |
| download | sigen-373e686bf4ecaaabcf80544e74f017eebe05213f.tar.gz sigen-373e686bf4ecaaabcf80544e74f017eebe05213f.tar.xz sigen-373e686bf4ecaaabcf80544e74f017eebe05213f.zip | |
[FIX] Cleaned up the RC file
[FIX] Script editing is getting there (still a little weird...)
[FIX] Cleaned up the main file a bit
[FIX] Added the Skin class
[FIX] All sprites and skins are internally linked now
[FIX] No more image restraints (tiles are still enforced so that map editing works)
[FIX] Cleaned up checking for valid values when setting in pokemod
[FIX] Removed FileDialog files
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@233 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/MapTrainerTeamMember.cpp')
| -rw-r--r-- | pokemod/MapTrainerTeamMember.cpp | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/pokemod/MapTrainerTeamMember.cpp b/pokemod/MapTrainerTeamMember.cpp index 762d0208..33bf2f7c 100644 --- a/pokemod/MapTrainerTeamMember.cpp +++ b/pokemod/MapTrainerTeamMember.cpp @@ -102,31 +102,24 @@ QDomElement Pokemod::MapTrainerTeamMember::save() const void Pokemod::MapTrainerTeamMember::setSpecies(const int species) { if (qobject_cast<const Pokemod*>(pokemod())->speciesIndex(species) == INT_MAX) - { emit(error(bounds("species"))); - return; - } - CHECK(species); + else + CHECK(species); } void Pokemod::MapTrainerTeamMember::setLevel(const int level) { if (qobject_cast<const Pokemod*>(pokemod())->rules()->maxLevel() < level) - { emit(error(bounds("level"))); - return; - } - CHECK(level); + else + CHECK(level); } void Pokemod::MapTrainerTeamMember::setAbility(const int ability, const bool state) { if (qobject_cast<const Pokemod*>(pokemod())->abilityIndex(ability) == INT_MAX) - { emit(error(bounds("ability"))); - return; - } - if (state && !m_ability.contains(ability)) + else if (state && !m_ability.contains(ability)) { if (m_ability.size() < qobject_cast<const Pokemod*>(pokemod())->rules()->maxAbilities()) { @@ -146,11 +139,8 @@ void Pokemod::MapTrainerTeamMember::setAbility(const int ability, const bool sta void Pokemod::MapTrainerTeamMember::setItem(const int item, const bool state) { if (qobject_cast<const Pokemod*>(pokemod())->itemIndex(item) == INT_MAX) - { emit(error(bounds("item"))); - return; - } - if (state && !m_item.contains(item)) + else if (state && !m_item.contains(item)) { if (m_item.size() < qobject_cast<const Pokemod*>(pokemod())->rules()->maxHeldItems()) { @@ -170,11 +160,8 @@ void Pokemod::MapTrainerTeamMember::setItem(const int item, const bool state) void Pokemod::MapTrainerTeamMember::setMove(const int move, const bool state) { if (qobject_cast<const Pokemod*>(pokemod())->moveIndex(move) == INT_MAX) - { emit(error(bounds("move"))); - return; - } - if (state && !m_move.contains(move)) + else if (state && !m_move.contains(move)) { const Species* species = qobject_cast<const Pokemod*>(pokemod())->speciesById(move); for (int i = 0; i < species->moveCount(); ++i) @@ -204,11 +191,8 @@ void Pokemod::MapTrainerTeamMember::setMove(const int move, const bool state) void Pokemod::MapTrainerTeamMember::setNature(const int nature, const bool state) { if (qobject_cast<const Pokemod*>(pokemod())->natureIndex(nature) == INT_MAX) - { emit(error(bounds("nature"))); - return; - } - if (state && !m_nature.contains(nature)) + else if (state && !m_nature.contains(nature)) { if (m_nature.size() < qobject_cast<const Pokemod*>(pokemod())->rules()->maxNatures()) { |
