summaryrefslogtreecommitdiffstats
path: root/pokemod/PokemonNature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/PokemonNature.cpp')
-rw-r--r--pokemod/PokemonNature.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/pokemod/PokemonNature.cpp b/pokemod/PokemonNature.cpp
index 2e5c6543..4987ee01 100644
--- a/pokemod/PokemonNature.cpp
+++ b/pokemod/PokemonNature.cpp
@@ -28,7 +28,7 @@ extern PokeGen::PokeMod::Pokemod curPokeMod;
PokeGen::PokeMod::PokemonNature::PokemonNature(const unsigned _id)
{
LogCtor("PokemonNature", _id);
- nature = -1;
+ nature = UINT_MAX;
weight = 1;
id = _id;
}
@@ -48,7 +48,6 @@ PokeGen::PokeMod::PokemonNature::~PokemonNature()
void PokeGen::PokeMod::PokemonNature::Validate()
{
- isValid = true;
LogValidateStart("PokemonNature", id);
if (!curPokeMod.GetNature(nature))
{
@@ -66,7 +65,6 @@ void PokeGen::PokeMod::PokemonNature::Validate()
#ifdef PG_DEBUG_WINDOW
void PokeGen::PokeMod::PokemonNature::Validate(const wxListBox &output)
{
- isValid = true;
LogValidateStart("PokemonNature", id);
if (!curPokeMod.GetNature(nature))
{
@@ -96,7 +94,7 @@ void PokeGen::PokeMod::PokemonNature::ImportIni(Ini &ini, const unsigned _id)
}
else
id = _id;
- ini.GetValue("nature", nature, -1);
+ ini.GetValue("nature", nature);
ini.GetValue("weight", weight, 1);
LogImportOver("PokemonNature", id);
}
@@ -113,10 +111,11 @@ void PokeGen::PokeMod::PokemonNature::ExportIni(std::ofstream &fout, const Strin
LogExportOver("PokemonNature", id);
}
-void PokeGen::PokeMod::PokemonNature::SetNature(const int n)
+void PokeGen::PokeMod::PokemonNature::SetNature(const unsigned n)
{
LogSetVar("PokemonNature", id, "nature", n);
- nature = n;
+ if (curPokeMod.GetNature(n))
+ nature = n;
}
void PokeGen::PokeMod::PokemonNature::SetNature(const String &n)
@@ -133,7 +132,7 @@ void PokeGen::PokeMod::PokemonNature::SetWeight(const unsigned w)
weight = w;
}
-int PokeGen::PokeMod::PokemonNature::GetNature() const
+unsigned PokeGen::PokeMod::PokemonNature::GetNature() const
{
LogFetchVar("PokemonNature", id, "nature", nature);
return nature;