Issue #16 new

Wrong Tiled Map parsing done by TiledMapPlus with Tiled 0.9.0

Anonymous created an issue

Hi there.

I noticed there is an error while using TiledMapPlus class and a tiled map made with version 0.9.0.

A part of my map looks like this:

<objectgroup name="objects" width="52" height="32">
  <object name="Message Computer" type="device" x="160" y="416" width="32" height="32">
   <properties>
    <property name="direction" value="west"/>
    <property name="image" value="COMPUTER_WALLTERMINAL_GREEN"/>
   </properties>
  </object>
  <object name="Atmosphere Terminal" type="device" x="32" y="544" width="32" height="32">
   <properties>
    <property name="direction" value="east"/>
    <property name="image" value="COMPUTER_WALLTERMINAL_GREEN"/>
   </properties>
  </object>
  <object name="Navigation Computer" type="device" x="32" y="448" width="32" height="32">
   <properties>
    <property name="direction" value="east"/>
    <property name="image" value="COMPUTER_WALLTERMINAL_GREEN"/>
   </properties>
  </object>
 </objectgroup>

So the corresponding ObjectGroup got their attributes right (name = objects, width and height). The problem is, that the ObjectGroup's properties are the same as the properties of the first object. Furthermore, there are 3 objects when calling ObjectGroup's getObjects(), but they all got the default values (empty strings, zeros and the like). Slick Build is #261.

Please check it out, thank you very much.

Comments (1)

  1. Roger Lehmann

    I just debugged that. It's possible for the GroupObject's constructor GroupObject(Element element, TiledMapPlus map) to not set the ObjectType at all. This is what's happening here. So the constructor runs through, just setting x and y correctly but not name, type, height and width. I suggest to give objectType a default value of RECTANGLE directly at definition or like it's done in the other GroupObject's constructor.

  2. Log in to comment