diff options
Diffstat (limited to 'pokemod/PokemonMove.cpp')
| -rw-r--r-- | pokemod/PokemonMove.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/pokemod/PokemonMove.cpp b/pokemod/PokemonMove.cpp index 848fc116..a211139c 100644 --- a/pokemod/PokemonMove.cpp +++ b/pokemod/PokemonMove.cpp @@ -28,7 +28,7 @@ extern PokeGen::PokeMod::Pokemod curPokeMod; PokeGen::PokeMod::PokemonMove::PokemonMove(const unsigned _id)
{
LogCtor("PokemonMove", _id);
- move = -1;
+ move = UINT_MAX;
level = 0;
wild = 0;
id = _id;
@@ -49,19 +49,18 @@ PokeGen::PokeMod::PokemonMove::~PokemonMove() void PokeGen::PokeMod::PokemonMove::Validate()
{
- isValid = true;
LogValidateStart("PokemonMove", id, GetMoveString());
if (!curPokeMod.GetMove(move))
{
LogVarNotValid("PokemonMove", id, "move");
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= level)
+ if (level < curPokeMod.GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "level", GetMoveString());
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= wild)
+ if (wild < curPokeMod.GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "wild", GetMoveString());
isValid = false;
@@ -72,7 +71,6 @@ void PokeGen::PokeMod::PokemonMove::Validate() #ifdef PG_DEBUG_WINDOW
void PokeGen::PokeMod::PokemonMove::Validate(const wxListBox &output)
{
- isValid = true;
LogValidateStart("PokemonMove", id, GetMoveString());
if (!curPokeMod.GetMove(move))
{
@@ -80,13 +78,13 @@ void PokeGen::PokeMod::PokemonMove::Validate(const wxListBox &output) output.Append(ConsoleLogVarNotValid("PokemonMove", id, "move"));
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= level)
+ if (level < curPokeMod.GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "level", GetMoveString());
output.Append(ConsoleLogVarNotValid("PokemonMove", id, "level", GetMoveString()));
isValid = false;
}
- if (curPokeMod.GetMaxLevel() <= wild)
+ if (wild < curPokeMod.GetMaxLevel())
{
LogVarNotValid("PokemonMove", id, "wild", GetMoveString());
output.Append(ConsoleLogVarNotValid("PokemonMove", id, "wild", GetMoveString()));
@@ -108,7 +106,7 @@ void PokeGen::PokeMod::PokemonMove::ImportIni(Ini &ini, const unsigned _id) }
else
id = _id;
- ini.GetValue("move", move, -1);
+ ini.GetValue("move", move);
ini.GetValue("level", level, 0);
ini.GetValue("wild", wild, 0);
LogImportOver("PokemonMove", id);
@@ -127,10 +125,11 @@ void PokeGen::PokeMod::PokemonMove::ExportIni(std::ofstream &fout, const String LogExportOver("PokemonMove", id);
}
-void PokeGen::PokeMod::PokemonMove::SetMove(const int m)
+void PokeGen::PokeMod::PokemonMove::SetMove(const unsigned m)
{
LogSetVar("PokemonMove", id, "move", m);
- move = m;
+ if (curPokeMod.GetMove(m))
+ move = m;
}
void PokeGen::PokeMod::PokemonMove::SetMove(const String &m)
@@ -143,16 +142,18 @@ void PokeGen::PokeMod::PokemonMove::SetMove(const String &m) void PokeGen::PokeMod::PokemonMove::SetLevel(const unsigned l)
{
LogSetVar("PokemonMove", id, "level", l, GetMoveString());
- level = l;
+ if (l < curPokeMod.GetMaxLevel())
+ level = l;
}
void PokeGen::PokeMod::PokemonMove::SetWild(const unsigned w)
{
LogSetVar("PokemonMove", id, "wild", w, GetMoveString());
- wild = w;
+ if (w < curPokeMod.GetMaxLevel())
+ wild = w;
}
-int PokeGen::PokeMod::PokemonMove::GetMove() const
+unsigned PokeGen::PokeMod::PokemonMove::GetMove() const
{
LogFetchVar("PokemonMove", id, "move", move);
return move;
|
