DS1.Tile() now calls update if dirty

This commit is contained in:
gravestench 2021-02-17 10:57:38 -08:00 committed by Dylan Knuth
parent 2353ef2e70
commit 4bc4fa0221
1 changed files with 4 additions and 0 deletions

View File

@ -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
}