aboutsummaryrefslogtreecommitdiff
path: root/client/map/map.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/map/map.gd')
-rw-r--r--client/map/map.gd5
1 files changed, 3 insertions, 2 deletions
diff --git a/client/map/map.gd b/client/map/map.gd
index 800cb57d..4dd76ec4 100644
--- a/client/map/map.gd
+++ b/client/map/map.gd
@@ -40,9 +40,10 @@ func get_tile_instance(pos: Vector2i) -> Tile:
else: return null
func set_tile(pos: Vector2i, tilename = null, neighbors: Array = [null,null,null,null]):
+ var inst = get_tile_instance(pos)
+ if inst and tilename: if inst.change(tilename): return # instance handled change itself
_remove_tile(pos)
- if tilename != null:
- _add_tile(pos, tilename, neighbors)
+ if tilename: _add_tile(pos, tilename, neighbors)
if autoflush: flush()
func _add_tile(pos: Vector2i, tilename: String, neighbors: Array) -> Tile: