diff options
Diffstat (limited to 'client')
| -rw-r--r-- | client/map/map.gd | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/client/map/map.gd b/client/map/map.gd index f711c603..4c7136c7 100644 --- a/client/map/map.gd +++ b/client/map/map.gd @@ -3,6 +3,7 @@ extends Node3D  var tile_by_pos: Dictionary = {}  var autobake = false +var currently_baked = false  func get_tile_name(pos: Vector2i):  	var e = tile_by_pos.get(str(pos)) @@ -34,10 +35,19 @@ func clear_tile(pos: Vector2i):  func _ready():  	voxelgi_timer.connect("timeout", gi_bake) +	Global.settings_changed.connect(func(): +		# is not baked yet but setting is true +		if Global.get_setting("voxel_gi") and not currently_baked: +			gi_bake() +		else: +			currently_baked = false +			voxelgi.data = null +	)  func gi_bake():  	if not Global.get_setting("voxel_gi"): return  	print("Map: Rebaking VoxelGI") +	currently_baked = true  	gi_bake_blocking()  func gi_bake_blocking(): | 
