correct copying of prefabs
This commit is contained in:
@ -54,12 +54,12 @@ func (l *Level) SetTileByXY (x,y int, tile *Tile) {
|
||||
}
|
||||
|
||||
func (l *Level) Put (x, y int, tileFunc interface{}) {
|
||||
tf := tileFunc.(func() *Tile)()
|
||||
if tf == nil {
|
||||
l.ctx.Logger().Fatal().Msgf("Got non-tile type to put into level: %v", tf)
|
||||
tile := tileFunc.(func() *Tile)()
|
||||
if tile == nil {
|
||||
l.ctx.Logger().Fatal().Msgf("Got non-tile type to put into level: %v", tile)
|
||||
}
|
||||
if l.InBounds(types.Coords{x, y}) {
|
||||
l.Tiles[y*l.W+x] = tf
|
||||
l.Tiles[y*l.W+x] = tile
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user