From 373e686bf4ecaaabcf80544e74f017eebe05213f Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 4 Aug 2008 03:27:13 +0000 Subject: [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 --- pokemod/MapTrainerTeamMember.cpp | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'pokemod/MapTrainerTeamMember.cpp') 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(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(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(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(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(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(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(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(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(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(pokemod())->rules()->maxNatures()) { -- cgit