[lua] Limit the possibility to create a tileset with origin != 0,0 (fix #4118)

This commit is contained in:
David Capello 2023-10-30 12:35:08 -03:00
parent 26523156da
commit 43079b226d

View File

@ -651,6 +651,14 @@ int Sprite_newTileset(lua_State* L)
}
}
}
// This a limitation in our code and doesn't make too much sense
// to specify a different origin by default (because the origin is
// specified on the tilemap cel).
if (grid.origin() != gfx::Point(0, 0)) {
return luaL_error(L, "a tileset with origin different than 0,0 cannot be created");
}
tileset = new Tileset(sprite, grid, ntiles);
}