aboutsummaryrefslogtreecommitdiff
path: root/client/map
diff options
context:
space:
mode:
Diffstat (limited to 'client/map')
-rw-r--r--client/map/map.gd10
1 files changed, 5 insertions, 5 deletions
diff --git a/client/map/map.gd b/client/map/map.gd
index 161b14fb..f6cb2f82 100644
--- a/client/map/map.gd
+++ b/client/map/map.gd
@@ -24,18 +24,18 @@ class TileInfo:
var tile: Tile
var neighbours: Array
-var tile_by_pos: Dictionary[String, TileInfo] = {}
+var tile_by_pos: Dictionary[Vector2i, TileInfo] = {}
var autobake = false
var currently_baked = false
var floor_node := MeshInstance3D.new()
var tile_factory = TileFactory.new()
func get_tile_name(pos: Vector2i): # -> String?
- var e = tile_by_pos.get(str(pos))
+ var e = tile_by_pos.get(pos)
if e != null: return e.name
else: return null
func get_tile_instance(pos: Vector2i) -> Tile:
- var e = tile_by_pos.get(str(pos))
+ var e = tile_by_pos.get(pos)
if e != null: return e.tile
else: return null
@@ -44,7 +44,7 @@ func set_tile(pos: Vector2i, name_: String, neighbors: Array = [null,null,null,n
var tile := tile_factory.produce(name_, pos, neighbors)
add_child(tile)
tile.position = Vector3(pos.x, 0, pos.y)
- tile_by_pos[str(pos)] = TileInfo.new(pos, name_, tile, neighbors)
+ tile_by_pos[pos] = TileInfo.new(pos, name_, tile, neighbors)
return tile
func clear_tile(pos: Vector2i):
@@ -56,7 +56,7 @@ func clear_tile(pos: Vector2i):
if floor_mesher != null:
floor_mesher.remove_tile(pos)
tile.queue_free()
- tile_by_pos.erase(str(pos))
+ tile_by_pos.erase(pos)
tile.name += "_queued_free"
@onready var voxelgi: VoxelGI = $VoxelGI