summaryrefslogtreecommitdiffstats
path: root/pokemod/Map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/Map.cpp')
-rw-r--r--pokemod/Map.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/pokemod/Map.cpp b/pokemod/Map.cpp
index d3c23879..1b1ac145 100644
--- a/pokemod/Map.cpp
+++ b/pokemod/Map.cpp
@@ -22,6 +22,8 @@
#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(""),
@@ -374,11 +376,8 @@ unsigned PokeGen::PokeMod::Map::GetEffectCount() const
const PokeGen::PokeMod::MapEffect* PokeGen::PokeMod::Map::NewEffect(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetEffectCount(); ++i)
- {
- if (GetEffectByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetEffectCount()) && (GetEffectByID(i) != UINT_MAX); ++i)
+ ;
MapEffect newEffect(pokemod, i);
if (ini)
newEffect.ImportIni(*ini);
@@ -421,11 +420,8 @@ unsigned PokeGen::PokeMod::Map::GetTrainerCount() const
const PokeGen::PokeMod::MapTrainer* PokeGen::PokeMod::Map::NewTrainer(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetTrainerCount(); ++i)
- {
- if (GetTrainerByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetTrainerCount()) && (GetTrainerByID(i) != UINT_MAX); ++i)
+ ;
MapTrainer newTrainer(pokemod, i);
if (ini)
newTrainer.ImportIni(*ini);
@@ -468,11 +464,8 @@ unsigned PokeGen::PokeMod::Map::GetWarpCount() const
const PokeGen::PokeMod::MapWarp* PokeGen::PokeMod::Map::NewWarp(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetWarpCount(); ++i)
- {
- if (GetWarpByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetWarpCount()) && (GetWarpByID(i) != UINT_MAX); ++i)
+ ;
MapWarp newWarp(pokemod, i);
if (ini)
newWarp.ImportIni(*ini);
@@ -515,11 +508,8 @@ unsigned PokeGen::PokeMod::Map::GetWildListCount() const
const PokeGen::PokeMod::MapWildList* PokeGen::PokeMod::Map::NewWildList(Ini* const ini)
{
unsigned i = 0;
- for (; i < GetWildListCount(); ++i)
- {
- if (GetWildListByID(i) == UINT_MAX)
- break;
- }
+ for (; (i < GetWildListCount()) && (GetWildListByID(i) != UINT_MAX); ++i)
+ ;
MapWildList newWildList(pokemod, i);
if (ini)
newWildList.ImportIni(*ini);