summaryrefslogtreecommitdiffstats
path: root/pokemod/Item.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2007-06-22 17:46:50 +0000
committerBen Boeckel <MathStuf@gmail.com>2007-06-22 17:46:50 +0000
commit5c3ca621f75587173bab3d946aee81dd2d36f495 (patch)
tree2d64b74bbe323a582cdc17f0a442c5ff1b48038e /pokemod/Item.cpp
parent3595239f08f2bc1df32ef22ed6de9bde10ca3384 (diff)
Pokemod validation, paths made to default
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@20 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Item.cpp')
-rw-r--r--pokemod/Item.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/pokemod/Item.cpp b/pokemod/Item.cpp
index 1e9d1c2c..8e123239 100644
--- a/pokemod/Item.cpp
+++ b/pokemod/Item.cpp
@@ -23,9 +23,7 @@
#include "Item.h"
-extern PokeGen::PokeMod::Pokemod curPokeMod;
-
-PokeGen::PokeMod::Item::Item(const unsigned _id) :
+PokeGen::PokeMod::Item::Item(const Pokemod *par, const unsigned _id) :
name(""),
sellable(false),
type(UINT_MAX),
@@ -34,11 +32,13 @@ PokeGen::PokeMod::Item::Item(const unsigned _id) :
{
LogCtor("Item", _id);
id = _id;
+ pokemod = par;
}
-PokeGen::PokeMod::Item::Item(Ini &ini, const unsigned _id)
+PokeGen::PokeMod::Item::Item(const Pokemod *par, Ini &ini, const unsigned _id)
{
LogCtorIni("Item", _id);
+ pokemod = par;
ImportIni(ini, _id);
if (id == UINT_MAX)
LogIdError("Item");
@@ -57,7 +57,7 @@ void PokeGen::PokeMod::Item::Validate()
LogVarNotSet("Item", id, "name");
isValid = false;
}
- if (!curPokeMod.GetItemStorage(type))
+ if (!pokemod->GetItemStorage(type))
{
LogVarNotValid("Item", id, "type", name);
isValid = false;
@@ -109,7 +109,7 @@ void PokeGen::PokeMod::Item::Validate(const wxListBox &output)
output.Append(ConsoleLogVarEmpty("Item", id, "name"));
isValid = false;
}
- if (!curPokeMod.GetItemStorage(type))
+ if (!pokemod->GetItemStorage(type))
{
LogVarNotValid("Item", id, "type", type, name);
output.Append(ConsoleLogVarNotValid("Item", id, "type", type, name));
@@ -208,14 +208,14 @@ void PokeGen::PokeMod::Item::SetSellable(const bool s)
void PokeGen::PokeMod::Item::SetType(const unsigned t)
{
LogSetVar("Item", id, "type", t, name);
- if (curPokeMod.GetItemStorage(t))
+ if (pokemod->GetItemStorage(t))
type = t;
}
void PokeGen::PokeMod::Item::SetType(const String &t)
{
LogSetVar("Item", id, "type string", t, name);
- if (const ItemStorage *i = curPokeMod.GetItemStorage(t))
+ if (const ItemStorage *i = pokemod->GetItemStorage(t))
type = i->GetId();
}
@@ -252,7 +252,7 @@ unsigned PokeGen::PokeMod::Item::GetType() const
PokeGen::PokeMod::String PokeGen::PokeMod::Item::GetTypeString() const
{
LogFetchVar("Item", id, "type string", type, name);
- if (const ItemStorage *i = curPokeMod.GetItemStorage(type))
+ if (const ItemStorage *i = pokemod->GetItemStorage(type))
return i->GetName();
return "";
}
@@ -295,7 +295,7 @@ void PokeGen::PokeMod::Item::NewItemEffect(Ini *const ini)
if (!GetItemEffect(i))
break;
}
- ItemEffect newItemEffect(i);
+ ItemEffect newItemEffect(pokemod, i);
if (ini)
newItemEffect.ImportIni(*ini);
LogSubmoduleNew("Item", id, "effect", i, name);