From c9afda3ab74614fb36986f96b7972c082f275eca Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 2 Jun 2007 18:12:48 +0000 Subject: Finished off all PokeMod classes, added move validations, fixed up some GUI, various other fixes git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@18 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemod/Store.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'pokemod/Store.cpp') 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); -- cgit