diff options
Diffstat (limited to 'pokemod/Tile.cpp')
| -rw-r--r-- | pokemod/Tile.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/pokemod/Tile.cpp b/pokemod/Tile.cpp index 8c0535d1..2c8e1c34 100644 --- a/pokemod/Tile.cpp +++ b/pokemod/Tile.cpp @@ -23,7 +23,7 @@ #include "Pokemod.h" #include "Tile.h" -const QStringList Tile::ForceStr = QStringList() << "None" << "Slip" << "Stop" << "Force" << "Push"; +const QStringList Tile::ForceStr = QStringList() << "Slip" << "Stop" << "Force" << "Push"; Tile::Tile(const Pokemod& par, const int _id) : Object("Tile", par, _id), @@ -169,12 +169,12 @@ void Tile::setWildChance(const int n, const int d) throw(Exception) wildChance.set(n, d); } -void Tile::setWildChanceNumerator(const int n) throw(Exception) +void Tile::setWildChanceNum(const int n) throw(Exception) { wildChance.setNum(n); } -void Tile::setWildChanceDenominator(const int d) throw(Exception) +void Tile::setWildChanceDenom(const int d) throw(Exception) { wildChance.setDenom(d); } @@ -189,10 +189,13 @@ void Tile::setHMType(const int h) throw(BoundsException) void Tile::setUnder(const int u) throw(Exception) { - if ((hmType != HM_Whirlpool) || (hmType != HM_Cut) || (hmType != HM_RockSmash)) - throw(UnusedException(className, "under")); - if ((u == id) || (pokemod.getTileIndex(u) == -1)) - throw(BoundsException(className, "under")); + if (hmType != -1) + { + if ((hmType != HM_Whirlpool) || (hmType != HM_Cut) || (hmType != HM_RockSmash)) + throw(UnusedException(className, "under")); + if ((u == id) || (pokemod.getTileIndex(u) == -1)) + throw(BoundsException(className, "under")); + } under = u; } @@ -205,10 +208,13 @@ void Tile::setForceType(const int f) throw(BoundsException) void Tile::setForceDirection(const int f) throw(Exception) { - if ((forceType == None) || (forceType == Stop)) - throw(UnusedException(className, "forceDirection")); - if (D_End <= f) - throw(BoundsException(className, "forceDirection")); + if (forceType != -1) + { + if (forceType == Stop) + throw(UnusedException(className, "forceDirection")); + if (D_End <= f) + throw(BoundsException(className, "forceDirection")); + } forceDirection = f; } |
