Browse code

fix bug with multiple tilesets

devnewton authored on 10/02/2014 at 16:55:06
Showing 1 changed files
... ...
@@ -87,6 +87,7 @@ public class TmxLoader {
87 87
                                     tileInstancePool.put(instance, instance);
88 88
                                 }
89 89
                                 layer.setTileAt(x, y, instance);
90
+                                break;
90 91
                             }
91 92
                         }
92 93
                     }
... ...
@@ -145,8 +146,8 @@ public class TmxLoader {
145 145
             if ("tileset".equals(child.name)) {
146 146
                 TmxTileset tileset = new TmxTileset();
147 147
                 String source = child.attributes.get("source");
148
+                tileset.setFirstgid(getMandatoryIntAttribute(child, "firstgid"));
148 149
                 if (null != source) {
149
-                    tileset.setFirstgid(getMandatoryIntAttribute(child, "firstgid"));
150 150
                     tileset.setSource(source);
151 151
                 } else {
152 152
                     parseTileset(child, map, tileset);