From f71140fae5218ee9839ffcd4ec83abfded5124f4 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 1 Jun 2007 02:54:29 +0000 Subject: Added Map and Tile, added Hat class, and fixed up some other minor things git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@17 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemod/PokemonMove.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'pokemod/PokemonMove.cpp') 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; -- cgit