From a9c4ad62380d7521a3cb87e978436b7cc2fd8ade Mon Sep 17 00:00:00 2001 From: Oskar Wiksten Date: Wed, 29 Aug 2012 23:12:41 +0200 Subject: [PATCH] Bugfix: only parse maps on worldmap that are actually present as maps. --- .../gpl/rpg/AndorsTrail/resource/parsers/WorldMapParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/resource/parsers/WorldMapParser.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/resource/parsers/WorldMapParser.java index 16513d291..18f30468b 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/resource/parsers/WorldMapParser.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/resource/parsers/WorldMapParser.java @@ -40,7 +40,7 @@ public final class WorldMapParser { } } - private static WorldMapSegment parseSegment(XmlResourceParser xrp, MapCollection maps) throws XmlPullParserException, IOException { + private static WorldMapSegment parseSegment(XmlResourceParser xrp, final MapCollection maps) throws XmlPullParserException, IOException { String segmentName = xrp.getAttributeValue(null, "id"); final WorldMapSegment segment = new WorldMapSegment(segmentName); @@ -50,6 +50,7 @@ public final class WorldMapParser { public void handleTag(XmlResourceParser xrp, String tagName) throws XmlPullParserException, IOException { if (tagName.equals("map")) { String mapName = xrp.getAttributeValue(null, "id"); + if (maps.findPredefinedMap(mapName) == null) return; Coord mapPosition = new Coord( xrp.getAttributeIntValue(null, "x", -1), xrp.getAttributeIntValue(null, "y", -1)