From: Oskar Wiksten Date: Wed, 29 Aug 2012 21:12:41 +0000 (+0200) Subject: Bugfix: only parse maps on worldmap that are actually present as maps. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a9c4ad62380d7521a3cb87e978436b7cc2fd8ade;p=users%2Fmchehab%2Fandors-trail.git Bugfix: only parse maps on worldmap that are actually present as maps. --- 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 16513d2..18f3046 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)