summaryrefslogtreecommitdiffstats
path: root/pokemod/MapWarp.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/MapWarp.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/MapWarp.cpp')
-rw-r--r--pokemod/MapWarp.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/pokemod/MapWarp.cpp b/pokemod/MapWarp.cpp
index ee7e4e5f..eb366464 100644
--- a/pokemod/MapWarp.cpp
+++ b/pokemod/MapWarp.cpp
@@ -23,9 +23,7 @@
#include "MapWarp.h"
-extern PokeGen::PokeMod::Pokemod curPokeMod;
-
-PokeGen::PokeMod::MapWarp::MapWarp(const unsigned _id) :
+PokeGen::PokeMod::MapWarp::MapWarp(const Pokemod *par, const unsigned _id) :
name(""),
coordinate(0, 0),
fromUp(false),
@@ -43,11 +41,13 @@ PokeGen::PokeMod::MapWarp::MapWarp(const unsigned _id) :
{
LogCtor("MapWarp", _id);
id = _id;
+ pokemod = par;
}
-PokeGen::PokeMod::MapWarp::MapWarp(Ini &ini, const unsigned _id)
+PokeGen::PokeMod::MapWarp::MapWarp(const Pokemod *par, Ini &ini, const unsigned _id)
{
LogCtorIni("MapWarp", _id);
+ pokemod = par;
ImportIni(ini, _id);
if (id == UINT_MAX)
LogIdError("MapWarp");
@@ -81,7 +81,7 @@ void PokeGen::PokeMod::MapWarp::Validate()
LogVarNotValid("MapWarp", id, "warpType", name);
isValid = false;
}
- if (const Map *m = curPokeMod.GetMap(toMap))
+ if (const Map *m = pokemod->GetMap(toMap))
{
if (!m->GetMapWarp(toWarp))
{
@@ -94,7 +94,7 @@ void PokeGen::PokeMod::MapWarp::Validate()
LogVarNotValid("MapWarp", id, "toMap");
isValid = false;
}
- if (!curPokeMod.GetDialog(dialog))
+ if (!pokemod->GetDialog(dialog))
{
LogVarNotValid("MapWarp", id, "dialog");
isValid = false;
@@ -130,7 +130,7 @@ void PokeGen::PokeMod::MapWarp::Validate(const wxListBox &output)
output.Append(ConsoleLogVarNotValid("MapWarp", id, "warpType", name));
isValid = false;
}
- if (const Map *m = curPokeMod.GetMap(toMap))
+ if (const Map *m = pokemod->GetMap(toMap))
{
if (!m->GetMapWarp(toWarp))
{
@@ -145,7 +145,7 @@ void PokeGen::PokeMod::MapWarp::Validate(const wxListBox &output)
output.Append(ConsoleLogVarNotValid("MapWarp", id, "toMap"));
isValid = false;
}
- if (!curPokeMod.GetDialog(dialog))
+ if (!pokemod->GetDialog(dialog))
{
LogVarNotValid("MapWarp", id, "dialog");
output.Append(ConsoleLogVarNotValid("MapWarp", id, "dialog"));
@@ -306,7 +306,7 @@ void PokeGen::PokeMod::MapWarp::SetIsFlash(const bool i)
void PokeGen::PokeMod::MapWarp::SetToMap(const unsigned t)
{
LogSetVar("MapWarp", id, "toMap", t, name);
- if (curPokeMod.GetMap(t))
+ if (pokemod->GetMap(t))
{
toMap = t;
toWarp = UINT_MAX;
@@ -316,7 +316,7 @@ void PokeGen::PokeMod::MapWarp::SetToMap(const unsigned t)
void PokeGen::PokeMod::MapWarp::SetToMap(const String &t)
{
LogSetVar("MapWarp", id, "toMap string", t, name);
- if (const Map *m = curPokeMod.GetMap(t))
+ if (const Map *m = pokemod->GetMap(t))
{
toMap = m->GetId();
toWarp = UINT_MAX;
@@ -326,7 +326,7 @@ void PokeGen::PokeMod::MapWarp::SetToMap(const String &t)
void PokeGen::PokeMod::MapWarp::SetToWarp(const unsigned t)
{
LogSetVar("MapWarp", id, "toWarp", t, name);
- if (const Map *m = curPokeMod.GetMap(toMap))
+ if (const Map *m = pokemod->GetMap(toMap))
{
if (m->GetMapWarp(t))
toWarp = t;
@@ -336,7 +336,7 @@ void PokeGen::PokeMod::MapWarp::SetToWarp(const unsigned t)
void PokeGen::PokeMod::MapWarp::SetToWarp(const String &t)
{
LogSetVar("MapWarp", id, "toWarp string", t, name);
- if (const Map *m = curPokeMod.GetMap(toMap))
+ if (const Map *m = pokemod->GetMap(toMap))
{
if (const MapWarp *w = m->GetMapWarp(t))
toWarp = w->GetId();
@@ -375,7 +375,7 @@ void PokeGen::PokeMod::MapWarp::SetWorkingFlagStatus(const String &s)
void PokeGen::PokeMod::MapWarp::SetDialog(const unsigned d)
{
LogSetVar("MapWarp", id, "dialog", d, name);
- if (curPokeMod.GetDialog(d))
+ if (pokemod->GetDialog(d))
dialog = d;
}
@@ -476,7 +476,7 @@ unsigned PokeGen::PokeMod::MapWarp::GetToMap() const
PokeGen::PokeMod::String PokeGen::PokeMod::MapWarp::GetToMapString() const
{
LogFetchVar("MapWarp", id, "toMap string", toMap, name);
- if (const Map *m = curPokeMod.GetMap(toMap))
+ if (const Map *m = pokemod->GetMap(toMap))
return m->GetName();
return "";
}
@@ -490,7 +490,7 @@ unsigned PokeGen::PokeMod::MapWarp::GetToWarp() const
PokeGen::PokeMod::String PokeGen::PokeMod::MapWarp::GetToWarpString() const
{
LogFetchVar("MapWarp", id, "toWarp string", toWarp, name);
- if (const Map *m = curPokeMod.GetMap(toMap))
+ if (const Map *m = pokemod->GetMap(toMap))
{
if (const MapWarp *w = m->GetMapWarp(toWarp))
return w->GetName();
@@ -531,7 +531,7 @@ unsigned PokeGen::PokeMod::MapWarp::GetDialog() const
PokeGen::PokeMod::String PokeGen::PokeMod::MapWarp::GetDialogString() const
{
LogFetchVar("MapWarp", id, "dialog string", dialog, name);
- if (const Dialog *d = curPokeMod.GetDialog(dialog))
+ if (const Dialog *d = pokemod->GetDialog(dialog))
return d->GetDialog();
return "";
}