summaryrefslogtreecommitdiffstats
path: root/pokemod/PokemonItem.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-06-02 18:12:48 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-06-02 18:12:48 +0000
commitc9afda3ab74614fb36986f96b7972c082f275eca (patch)
tree1b7c0b31950597d6ed562d94158dd3f8701496da /pokemod/PokemonItem.cpp
parentf71140fae5218ee9839ffcd4ec83abfded5124f4 (diff)
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
Diffstat (limited to 'pokemod/PokemonItem.cpp')
-rw-r--r--pokemod/PokemonItem.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/pokemod/PokemonItem.cpp b/pokemod/PokemonItem.cpp
index f84a3b52..af4a9626 100644
--- a/pokemod/PokemonItem.cpp
+++ b/pokemod/PokemonItem.cpp
@@ -25,11 +25,11 @@
extern PokeGen::PokeMod::Pokemod curPokeMod;
-PokeGen::PokeMod::PokemonItem::PokemonItem(const unsigned _id)
+PokeGen::PokeMod::PokemonItem::PokemonItem(const unsigned _id) :
+ item(UINT_MAX),
+ weight(1)
{
LogCtor("PokemonItem", _id);
- item = UINT_MAX;
- weight = 1;
id = _id;
}
@@ -87,7 +87,7 @@ void PokeGen::PokeMod::PokemonItem::ImportIni(Ini &ini, const unsigned _id)
LogImportStart("PokemonItem");
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("PokemonItem");
@@ -121,7 +121,7 @@ void PokeGen::PokeMod::PokemonItem::SetItem(const unsigned i)
void PokeGen::PokeMod::PokemonItem::SetItem(const String &i)
{
LogSetVar("PokemonItem", id, "item", i);
- if (Item *temp = curPokeMod.GetItem(i))
+ if (const Item *temp = curPokeMod.GetItem(i))
item = temp->GetId();
}
@@ -141,7 +141,7 @@ unsigned PokeGen::PokeMod::PokemonItem::GetItem() const
PokeGen::PokeMod::String PokeGen::PokeMod::PokemonItem::GetItemString() const
{
LogFetchVar("PokemonItem", id, "item string", item);
- if (Item *i = curPokeMod.GetItem(item))
+ if (const Item *i = curPokeMod.GetItem(item))
return i->GetName();
return "";
}