From 4385af885daf460a18e236f08509358f764b2c8c Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 26 Oct 2007 20:46:09 +0000 Subject: Reverted repo back to rev24 because committing of rev25 messed up git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@26 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemod/Map.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'pokemod/Map.cpp') diff --git a/pokemod/Map.cpp b/pokemod/Map.cpp index 1b1ac145..d3c23879 100644 --- a/pokemod/Map.cpp +++ b/pokemod/Map.cpp @@ -22,8 +22,6 @@ #include "Map.h" -const char* PokeGen::PokeMod::Map::TypeStr[PokeGen::PokeMod::Map::End] = {"Outdoor", "Dungeon", "Building"}; - PokeGen::PokeMod::Map::Map(const Pokemod* par, const unsigned _id) : Object(_id, par), name(""), @@ -376,8 +374,11 @@ unsigned PokeGen::PokeMod::Map::GetEffectCount() const const PokeGen::PokeMod::MapEffect* PokeGen::PokeMod::Map::NewEffect(Ini* const ini) { unsigned i = 0; - for (; (i < GetEffectCount()) && (GetEffectByID(i) != UINT_MAX); ++i) - ; + for (; i < GetEffectCount(); ++i) + { + if (GetEffectByID(i) == UINT_MAX) + break; + } MapEffect newEffect(pokemod, i); if (ini) newEffect.ImportIni(*ini); @@ -420,8 +421,11 @@ unsigned PokeGen::PokeMod::Map::GetTrainerCount() const const PokeGen::PokeMod::MapTrainer* PokeGen::PokeMod::Map::NewTrainer(Ini* const ini) { unsigned i = 0; - for (; (i < GetTrainerCount()) && (GetTrainerByID(i) != UINT_MAX); ++i) - ; + for (; i < GetTrainerCount(); ++i) + { + if (GetTrainerByID(i) == UINT_MAX) + break; + } MapTrainer newTrainer(pokemod, i); if (ini) newTrainer.ImportIni(*ini); @@ -464,8 +468,11 @@ unsigned PokeGen::PokeMod::Map::GetWarpCount() const const PokeGen::PokeMod::MapWarp* PokeGen::PokeMod::Map::NewWarp(Ini* const ini) { unsigned i = 0; - for (; (i < GetWarpCount()) && (GetWarpByID(i) != UINT_MAX); ++i) - ; + for (; i < GetWarpCount(); ++i) + { + if (GetWarpByID(i) == UINT_MAX) + break; + } MapWarp newWarp(pokemod, i); if (ini) newWarp.ImportIni(*ini); @@ -508,8 +515,11 @@ unsigned PokeGen::PokeMod::Map::GetWildListCount() const const PokeGen::PokeMod::MapWildList* PokeGen::PokeMod::Map::NewWildList(Ini* const ini) { unsigned i = 0; - for (; (i < GetWildListCount()) && (GetWildListByID(i) != UINT_MAX); ++i) - ; + for (; i < GetWildListCount(); ++i) + { + if (GetWildListByID(i) == UINT_MAX) + break; + } MapWildList newWildList(pokemod, i); if (ini) newWildList.ImportIni(*ini); -- cgit