From 69666f37c6551c1a40676a9c18c59be8935a76f0 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 26 Feb 2020 12:19:55 +0100 Subject: [PATCH] Fix editor freeze on loading saved chunks. --- game/voxelman/world/TVVoxelChunk.gd | 1 + game/voxelman/world/TVVoxelWorld.gd | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/game/voxelman/world/TVVoxelChunk.gd b/game/voxelman/world/TVVoxelChunk.gd index 0562001c..469cb7b3 100644 --- a/game/voxelman/world/TVVoxelChunk.gd +++ b/game/voxelman/world/TVVoxelChunk.gd @@ -1,3 +1,4 @@ +tool extends VoxelChunk class_name TVVoxelChunk diff --git a/game/voxelman/world/TVVoxelWorld.gd b/game/voxelman/world/TVVoxelWorld.gd index 86b666f3..74c8f20f 100644 --- a/game/voxelman/world/TVVoxelWorld.gd +++ b/game/voxelman/world/TVVoxelWorld.gd @@ -40,15 +40,16 @@ var _player_file_name : String var _player : Entity func _enter_tree(): -# for ch in get_children(): -# if ch is VoxelChunk: -# var c : VoxelChunk = ch as VoxelChunk -# -# c.set_voxel_world(self) -# c.set_library(library) -# c.set_size(c.size_x, c.size_y, c.size_z, c.margin_start, c.margin_end) -# add_chunk(c, c.position_x, c.position_y, c.position_z) -# c.build_deferred() + for ch in get_children(): + if ch is VoxelChunk: + var c : VoxelChunk = ch as VoxelChunk + + c.set_voxel_world(self) + c.set_library(library) + c.set_size(c.size_x, c.size_y, c.size_z, c.margin_start, c.margin_end) +# c.is_build_threaded = false + add_chunk(c, c.position_x, c.position_y, c.position_z) + c.build_deferred()