summaryrefslogtreecommitdiffstats
path: root/sigmodr/models/CoinListObjectModel.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-11-08 06:15:08 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-11-08 06:15:08 +0000
commit8bad37e82371bd41864903ac0d6f49808ad119bf (patch)
tree77f0cb46059654cefb357d6eb4064c5740edf3d4 /sigmodr/models/CoinListObjectModel.cpp
parentc127c0dae65a7600e0ab30b634f25d4915c61d16 (diff)
downloadsigen-8bad37e82371bd41864903ac0d6f49808ad119bf.tar.gz
sigen-8bad37e82371bd41864903ac0d6f49808ad119bf.tar.xz
sigen-8bad37e82371bd41864903ac0d6f49808ad119bf.zip
[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
Diffstat (limited to 'sigmodr/models/CoinListObjectModel.cpp')
-rw-r--r--sigmodr/models/CoinListObjectModel.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/sigmodr/models/CoinListObjectModel.cpp b/sigmodr/models/CoinListObjectModel.cpp
index ee74e2e4..8264e272 100644
--- a/sigmodr/models/CoinListObjectModel.cpp
+++ b/sigmodr/models/CoinListObjectModel.cpp
@@ -50,15 +50,15 @@ QVariant Sigmodr::CoinListObjectModel::data(int role) const
Sigmod::CoinListObject* object = qobject_cast<Sigmod::CoinListObject*>(m_object);
if (object->type() == Sigmod::CoinListObject::Item)
{
- const int index = qobject_cast<const Sigmod::Sigmod*>(m_object->sigmod())->itemIndex(object->object());
- if (index != INT_MAX)
- return qobject_cast<const Sigmod::Sigmod*>(m_object->sigmod())->item(index)->name();
+ const Sigmod::Item* item = m_object->sigmod()->itemById(object->object());
+ if (item)
+ return item->name();
}
else if (object->type() == Sigmod::CoinListObject::Species)
{
- const int index = qobject_cast<const Sigmod::Sigmod*>(m_object->sigmod())->speciesIndex(object->object());
- if (index != INT_MAX)
- return qobject_cast<const Sigmod::Sigmod*>(m_object->sigmod())->species(index)->name();
+ const Sigmod::Species* species = m_object->sigmod()->speciesById(object->object());
+ if (species)
+ return species->name();
}
return "";
}