summaryrefslogtreecommitdiffstats
path: root/pokemod/Store.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/Store.cpp')
-rw-r--r--pokemod/Store.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/pokemod/Store.cpp b/pokemod/Store.cpp
index 7f5936c2..5d75ac37 100644
--- a/pokemod/Store.cpp
+++ b/pokemod/Store.cpp
@@ -25,11 +25,10 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::Store::Store(const unsigned _id)
+PokeGen::PokeMod::Store::Store(const unsigned _id) :
+ name("")
{
LogCtor("Store", _id);
- name = "";
- items.clear();
id = _id;
}
@@ -93,7 +92,7 @@ void PokeGen::PokeMod::Store::ImportIni(Ini &ini, const unsigned _id)
LogImportStart("Store");
if (_id == UINT_MAX)
{
- ini.GetValue("id", id, UINT_MAX);
+ ini.GetValue("id", id);
// Was there an id associated with the element?
if (id == UINT_MAX)
LogIdNotFound("Store");
@@ -180,11 +179,11 @@ void PokeGen::PokeMod::Store::NewItem(const unsigned i)
items.push_back(i);
}
-void PokeGen::PokeMod::Store::NewItem(const String &i)
+void PokeGen::PokeMod::Store::NewItem(const String &n)
{
- LogSubmoduleNew("Store", id, "item", i);
- if (Item *temp = curPokeMod.GetItem(i))
- items.push_back(temp->GetId());
+ LogSubmoduleNew("Store", id, "item", n);
+ if (const Item *i = curPokeMod.GetItem(n))
+ items.push_back(i->GetId());
}
void PokeGen::PokeMod::Store::DeleteItem(const unsigned i)
@@ -199,7 +198,7 @@ void PokeGen::PokeMod::Store::DeleteItem(const unsigned i)
void PokeGen::PokeMod::Store::DeleteItem(const String &n)
{
LogSubmoduleRemoveStart("Store", id, "item", n, name);
- if (Item *i = curPokeMod.GetItem(n))
+ if (const Item *i = curPokeMod.GetItem(n))
DeleteItemByID(i->GetId());
else
LogSubmoduleRemoveFail("Store", id, "item", n, name);