]> www.infradead.org Git - users/mchehab/andors-trail.git/commitdiff
Bugfix: only parse maps on worldmap that are actually present as maps.
authorOskar Wiksten <oskar.wiksten@gmail.com>
Wed, 29 Aug 2012 21:12:41 +0000 (23:12 +0200)
committerOskar Wiksten <oskar.wiksten@gmail.com>
Sun, 7 Oct 2012 14:41:23 +0000 (16:41 +0200)
AndorsTrail/src/com/gpl/rpg/AndorsTrail/resource/parsers/WorldMapParser.java

index 16513d2915e5d3c94b4885163c43fb9efe5707cb..18f30468b1e02768ad03a56f10c85caf51051568 100644 (file)
@@ -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)