summaryrefslogtreecommitdiffstats
path: root/pokemod/Store.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/Store.cpp')
-rw-r--r--pokemod/Store.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/pokemod/Store.cpp b/pokemod/Store.cpp
index 626b249d..ab20947b 100644
--- a/pokemod/Store.cpp
+++ b/pokemod/Store.cpp
@@ -57,7 +57,7 @@ bool PokeMod::Store::validate() const
QMap<unsigned, unsigned> nameChecker;
for (QListIterator<unsigned> i(items); i.hasNext(); i.next())
{
- if (pokemod.getItemByID(i.peekNext()) == UINT_MAX)
+ if (pokemod.getItemIndex(i.peekNext()) == UINT_MAX)
{
pokemod.validationMsg("Invalid item");
valid = false;
@@ -113,6 +113,8 @@ void PokeMod::Store::setName(const QString& n)
void PokeMod::Store::setItem(const unsigned itm, const bool it) throw(Exception)
{
+ if (pokemod.getItemIndex(itm) == UINT_MAX)
+ throw(BoundsException("Store", "item"));
for (QMutableListIterator<unsigned> i(items); i.hasNext(); )
{
if (i.next() == itm)
@@ -133,11 +135,11 @@ QString PokeMod::Store::getName() const
return name;
}
-bool PokeMod::Store::getItem(const unsigned it) const
+bool PokeMod::Store::getItem(const unsigned itm) const
{
for (QListIterator<unsigned> i(items); i.hasNext(); )
{
- if (i.next() == it)
+ if (i.next() == itm)
return true;
}
return false;