From 300e44b68e075d7fd78287e10262b0d502f4898d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 28 Jun 2008 19:37:45 +0000 Subject: [FIX] Macros fixed and ID can't be set outside of constructors [FIX] Map flyWarp no longer raises and error by default git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@216 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemod/Map.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'pokemod/Map.cpp') diff --git a/pokemod/Map.cpp b/pokemod/Map.cpp index b2ba980c..93815983 100644 --- a/pokemod/Map.cpp +++ b/pokemod/Map.cpp @@ -40,7 +40,7 @@ Pokemod::Map::Map(const Map& map) : Pokemod::Map::Map(const Pokemod* parent, const int id) : Object("Map", parent, id), m_name(""), - m_flyWarp(INT_MAX), + m_flyWarp(-1), m_type(INT_MAX) { } @@ -54,7 +54,8 @@ Pokemod::Map::Map(const Map& map, const Pokemod* parent, const int id) : Pokemod::Map::Map(const QDomElement& xml, const Pokemod* parent, const int id) : Object("Map", parent, id) { - load(xml, id); + LOAD_ID(); + load(xml); } Pokemod::Map::~Map() @@ -103,9 +104,9 @@ void Pokemod::Map::validate() TEST_END(); } -void Pokemod::Map::load(const QDomElement& xml, int id) +void Pokemod::Map::load(const QDomElement& xml) { - LOAD_ID(); + LOAD_BEGIN(); LOAD(QString, name); LOAD(int, flyWarp); LOAD(int, type); @@ -137,7 +138,7 @@ void Pokemod::Map::setName(const QString& name) void Pokemod::Map::setFlyWarp(const int flyWarp) { - if ((flyWarp != INT_MAX) && (warpIndex(flyWarp) == INT_MAX)) + if ((flyWarp != -1) && (warpIndex(flyWarp) == INT_MAX)) { emit(error(bounds("flyWarp"))); return; -- cgit