From 4bc4fa0221d68c7ef63628534235f409e6a83996 Mon Sep 17 00:00:00 2001 From: gravestench Date: Wed, 17 Feb 2021 10:57:38 -0800 Subject: [PATCH] DS1.Tile() now calls update if dirty --- d2common/d2fileformats/d2ds1/ds1.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/d2common/d2fileformats/d2ds1/ds1.go b/d2common/d2fileformats/d2ds1/ds1.go index 21d198f1..d62a65d7 100644 --- a/d2common/d2fileformats/d2ds1/ds1.go +++ b/d2common/d2fileformats/d2ds1/ds1.go @@ -140,6 +140,10 @@ func (ds1 *DS1) SetTiles(tiles [][]Tile) { // Tile returns the tile at the given x,y tile coordinate (nil if x,y is out of bounds) func (ds1 *DS1) Tile(x, y int) *Tile { + if ds1.dirty { + ds1.update() + } + if y >= len(ds1.tiles) { return nil }