summaryrefslogtreecommitdiffstats
path: root/pokemod/Nature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/Nature.cpp')
-rw-r--r--pokemod/Nature.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/pokemod/Nature.cpp b/pokemod/Nature.cpp
index 3ae75b96..52e597b6 100644
--- a/pokemod/Nature.cpp
+++ b/pokemod/Nature.cpp
@@ -34,7 +34,7 @@ Pokemod::Nature::Nature(const Pokemod* parent, const int id) :
m_name(""),
m_weight(1)
{
- for (int i = 0; i < ST_End_GSC; ++i)
+ for (int i = 0; i < (ST_End_GSC - ST_No_HP_Start); ++i)
m_stat[i].set(1, 1);
}
@@ -64,7 +64,7 @@ void Pokemod::Nature::load(const QDomElement& xml)
{
LOAD_BEGIN();
LOAD(QString, name);
- LOAD_ARRAY(Fraction, stat, ST_End_GSC);
+ LOAD_ARRAY(Fraction, stat, ST_End_GSC - ST_No_HP_Start);
LOAD(int, weight);
}
@@ -72,7 +72,7 @@ QDomElement Pokemod::Nature::save() const
{
SAVE_CREATE();
SAVE(QString, name);
- SAVE_ARRAY(Fraction, stat, ST_End_GSC);
+ SAVE_ARRAY(Fraction, stat, ST_End_GSC - ST_No_HP_Start);
SAVE(int, weight);
return xml;
}
@@ -84,7 +84,7 @@ void Pokemod::Nature::setName(const QString& name)
void Pokemod::Nature::setStat(const int stat, const Fraction& multiplier)
{
- if ((static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? ST_End_GSC : ST_End_RBY) <= stat)
+ if ((stat < ST_No_HP_Start) || ((static_cast<const Pokemod*>(pokemod())->rules()->specialSplit() ? ST_End_GSC : ST_End_RBY) <= stat))
{
emit(error(bounds("stat")));
return;
@@ -127,7 +127,7 @@ Pokemod::Nature& Pokemod::Nature::operator=(const Nature& rhs)
if (this == &rhs)
return *this;
COPY(name);
- COPY_ARRAY(stat, ST_End_GSC);
+ COPY_ARRAY(stat, ST_End_GSC - ST_No_HP_Start);
COPY(weight);
return *this;
}