Skip to content

Commit bb54851

Browse files
committed
Critical bug fix
1 parent ecc267b commit bb54851

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

LDtkParser.yymps

21 KB
Binary file not shown.

LDtkParserMin.yymps

7.71 KB
Binary file not shown.

scripts/LDtkParser/LDtkParser.gml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,23 @@ function LDtkLoad(level_name) {
315315
//var empty_tile = 0
316316
//tilemap_clear(tilemap, empty_tile)
317317

318+
// this is layer's cell size
319+
//var cwid = this_layer.__cWid
320+
//var chei = this_layer.__cHei
321+
322+
// this is tileset's cell size
323+
var cwid = -1
324+
var chei = -1
325+
326+
for(var ts = 0; ts < array_length(data.defs.tilesets); ++ts) {
327+
var tileset_def = data.defs.tilesets[ts]
328+
329+
if tileset_def.uid == this_layer.__tilesetDefUid {
330+
cwid = tileset_def.__cWid
331+
chei = tileset_def.__cHei
332+
}
333+
}
318334

319-
var cwid = this_layer.__cWid
320-
var chei = this_layer.__cHei
321335

322336
var tile_size = this_layer.__gridSize
323337

0 commit comments

Comments
 (0)