Skip to content

Commit

Permalink
bugreport: added a sample for a bug report with a failing load (see l…
Browse files Browse the repository at this point in the history
  • Loading branch information
nexovec committed Feb 3, 2025
1 parent be90f06 commit c86649a
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bugs/failing_load/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module tmx_bug_repro

go 1.23.4

require (
github.com/lafriks/go-tiled v0.13.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
)
4 changes: 4 additions & 0 deletions bugs/failing_load/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/lafriks/go-tiled v0.13.0 h1:xZE2rEKCNJPya+g92FCIjzEH4fZLQcZVqvpw174P2MY=
github.com/lafriks/go-tiled v0.13.0/go.mod h1:FRhv/27R9S9IOmDl7+XrSUjFrV0uCUCu23rTCHRuj5c=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
17 changes: 17 additions & 0 deletions bugs/failing_load/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package main

import (
"log/slog"

"github.com/lafriks/go-tiled"
"github.com/pkg/errors"
)

func main() {
tiledMap, err := tiled.LoadFile("platform.tmx")
if err != nil {
panic(errors.WithStack(err))
}
slog.Debug("tiled level", "tiles", tiledMap.Layers[0].Tiles)

}
44 changes: 44 additions & 0 deletions bugs/failing_load/platform.tmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.8" tiledversion="1.8.0" orientation="orthogonal" renderorder="right-down" width="100" height="100" tilewidth="8" tileheight="8" infinite="1" nextlayerid="2" nextobjectid="1">
<tileset firstgid="1" source="ship-01.tsx"/>
<layer id="1" name="Tile Layer 1" width="100" height="100">
<data encoding="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