rcorre / dtiled

D language parser for Tiled map files.
MIT License
16 stars 2 forks source link

Cannot parse GID 0 #9

Open grogancolin opened 8 years ago

grogancolin commented 8 years ago

DTiled currently falls over when a tile has GID 0.

However, Tiled used GID 0 for an empty tile.

rcorre commented 8 years ago

Thanks for reporting. Any context on where this fails? Certain things are expected to fail when a GID is 0 -- for example, getTileset will fail as an empty tile belongs to no tileset. While I could do something like return a Nullable!Tileset, I think it makes more sense for the user to skip over empty tiles on their end. For example, note how the map-building code in dtiled-example explicitly checks for 0 GIDs.