1. Chris Klimas
  2. zoetrope


Chris Klimas  committed 64ab3a1

Fix reference to ipairs()

Because Tiled sprite ids may not be continuous or start at 1, we need to
use pairs() instead of ipairs().

This fixes bug 13.

  • Participants
  • Parent commits 52ed4d9
  • Branches default

Comments (0)

Files changed (1)

File zoetrope/core/view.lua

View file
  • Ignore whitespace
 						-- and mix in properties where applicable
-						for i, tile in ipairs(tileProtos) do
-							if map.sprites[i] then
-								map.sprites[i]:mixin(tile.properties)
+						for id, tile in pairs(tileProtos) do
+							if map.sprites[id] then
+								map.sprites[id]:mixin(tile.properties)