summaryrefslogtreecommitdiffstats
path: root/pokemod/Map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/Map.cpp')
-rw-r--r--pokemod/Map.cpp36
1 files changed, 12 insertions, 24 deletions
diff --git a/pokemod/Map.cpp b/pokemod/Map.cpp
index d66552e6..8c388861 100644
--- a/pokemod/Map.cpp
+++ b/pokemod/Map.cpp
@@ -262,15 +262,13 @@ Point Map::size() const
const MapEffect* Map::effect(const int index) const
{
- if (effectCount() <= index)
- return NULL;
+ Q_ASSERT(index < effectCount());
return m_effects.at(index);
}
MapEffect* Map::effect(const int index)
{
- if (effectCount() <= index)
- return NULL;
+ Q_ASSERT(index < effectCount());
return m_effects[index];
}
@@ -322,8 +320,7 @@ MapEffect* Map::newEffect(MapEffect* effect)
void Map::deleteEffect(const int index)
{
- if (effectCount() <= index)
- return;
+ Q_ASSERT(index < effectCount());
delete m_effects[index];
m_effects.removeAt(index);
}
@@ -343,15 +340,13 @@ int Map::newEffectId() const
const MapTrainer* Map::trainer(const int index) const
{
- if (trainerCount() <= index)
- return NULL;
+ Q_ASSERT(index < trainerCount());
return m_trainers.at(index);
}
MapTrainer* Map::trainer(const int index)
{
- if (trainerCount() <= index)
- return NULL;
+ Q_ASSERT(index < trainerCount());
return m_trainers[index];
}
@@ -403,8 +398,7 @@ MapTrainer* Map::newTrainer(MapTrainer* trainer)
void Map::deleteTrainer(const int index)
{
- if (trainerCount() <= index)
- return;
+ Q_ASSERT(index < trainerCount());
delete m_trainers[index];
m_trainers.removeAt(index);
}
@@ -424,15 +418,13 @@ int Map::newTrainerId() const
const MapWarp* Map::warp(const int index) const
{
- if (warpCount() <= index)
- return NULL;
+ Q_ASSERT(index < warpCount());
return m_warps.at(index);
}
MapWarp* Map::warp(const int index)
{
- if (warpCount() <= index)
- return NULL;
+ Q_ASSERT(index < warpCount());
return m_warps[index];
}
@@ -484,8 +476,7 @@ MapWarp* Map::newWarp(MapWarp* warp)
void Map::deleteWarp(const int index)
{
- if (warpCount() <= index)
- return;
+ Q_ASSERT(index < warpCount());
delete m_warps[index];
m_warps.removeAt(index);
}
@@ -505,15 +496,13 @@ int Map::newWarpId() const
const MapWildList* Map::wildList(const int index) const
{
- if (wildListCount() <= index)
- return NULL;
+ Q_ASSERT(index < wildListCount());
return m_wildLists.at(index);
}
MapWildList* Map::wildList(const int index)
{
- if (wildListCount() <= index)
- return NULL;
+ Q_ASSERT(index < wildListCount());
return m_wildLists[index];
}
@@ -565,8 +554,7 @@ MapWildList* Map::newWildList(MapWildList* wildList)
void Map::deleteWildList(const int index)
{
- if (wildListCount() <= index)
- return;
+ Q_ASSERT(index < wildListCount());
delete m_wildLists[index];
m_wildLists.removeAt(index);
}