Bugfix: only parse maps on worldmap that are actually present as maps.

This commit is contained in:
Oskar Wiksten
2012-08-29 23:12:41 +02:00
parent 1b2bdfa4e0
commit a9c4ad6238

View 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)