From 8bad37e82371bd41864903ac0d6f49808ad119bf Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 8 Nov 2008 06:15:08 +0000 Subject: [FIX] No more asserts in sigmod [FIX] Moved to using *ById instead of *Index methods in sigmod [FIX] Tilemaps are now collaged (not completely done on the editing side yet) [FIX] Removed the resource files (drawn natively instead) [FIX] ATBTimer now uses the built-in QTimer in a QObject [FIX] Coordinates are now edited on the map for warps, trainers, and effects [FIX] Tiles are now completely scripted [FIX] Config is now thread-safe git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@308 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- sigmod/MapWildList.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'sigmod/MapWildList.cpp') diff --git a/sigmod/MapWildList.cpp b/sigmod/MapWildList.cpp index 1f8b9c17..1a385632 100644 --- a/sigmod/MapWildList.cpp +++ b/sigmod/MapWildList.cpp @@ -97,14 +97,16 @@ QString Sigmod::MapWildList::name() const const Sigmod::MapWildListEncounter* Sigmod::MapWildList::encounter(const int index) const { - Q_ASSERT(index < encounterCount()); - return m_encounters.at(index); + if (index < encounterCount()) + return m_encounters.at(index); + return NULL; } Sigmod::MapWildListEncounter* Sigmod::MapWildList::encounter(const int index) { - Q_ASSERT(index < encounterCount()); - return m_encounters[index]; + if (index < encounterCount()) + return m_encounters[index]; + return NULL; } const Sigmod::MapWildListEncounter* Sigmod::MapWildList::encounterById(const int id) const @@ -155,9 +157,11 @@ Sigmod::MapWildListEncounter* Sigmod::MapWildList::newEncounter(MapWildListEncou void Sigmod::MapWildList::deleteEncounter(const int index) { - Q_ASSERT(index < encounterCount()); - delete m_encounters[index]; - m_encounters.removeAt(index); + if (index < encounterCount()) + { + delete m_encounters[index]; + m_encounters.removeAt(index); + } } void Sigmod::MapWildList::deleteEncounterById(const int id) -- cgit