From ae0d64a0698f864566f166ac0187d342864c87f9 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 12 Mar 2020 13:50:14 +0100 Subject: [PATCH] Few small fixes/cleanups. Also updated heads to get an uninitialized variable fix from ESS. This fixed player spawning issues. --- HEADS | 2 +- game/autoload/Entities.gd | 3 ++- game/scenes/CharacterSelectorMenu.gd | 2 +- game/voxelman/world/TVVoxelChunk.gd | 14 +++++++------- game/voxelman/world/TVVoxelMesher.gd | 10 +++++----- game/voxelman/world/TVVoxelWorld.gd | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/HEADS b/HEADS index 42db780e..4ffe4f8a 100644 --- a/HEADS +++ b/HEADS @@ -1 +1 @@ -{"engine": {"3.2": "34dc32aeb8b06947897f75399c15f3eb9c211d7b", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "a08917370cdef0884042bdb49fb80ece0b2e76ec"}, "entity_spell_system": {"master": "b66de0a8946d17913bd7f3877e2f77b7ef08c3b8"}, "ui_extensions": {"master": "38acc650db260a831dc26ca96fe9d9a087230bdc"}, "voxelman": {"master": "91540092500d8b8bd0c12322e46f4e10a00c66ae"}, "texture_packer": {"master": "b17c174906f84de93d84aa60d010ffe603efaa28"}, "fastnoise": {"master": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e"}, "mesh_data_resource": {"master": "4bda19b12be2c2a79a6121de6d22e48f3934e726"}, "procedural_animations": {"master": "9b1868668de4242ccc0565cf3c6b5e1c375f1576"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "fast_quadratic_mesh_simplifier": {"master": "3144600da9dd00595518c5f0d4cc2cc400825c86"}} \ No newline at end of file +{"engine": {"3.2": "34dc32aeb8b06947897f75399c15f3eb9c211d7b", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "a08917370cdef0884042bdb49fb80ece0b2e76ec"}, "entity_spell_system": {"master": "bff7b220c40216f625a028af144b174620106c59"}, "ui_extensions": {"master": "38acc650db260a831dc26ca96fe9d9a087230bdc"}, "voxelman": {"master": "91540092500d8b8bd0c12322e46f4e10a00c66ae"}, "texture_packer": {"master": "b17c174906f84de93d84aa60d010ffe603efaa28"}, "fastnoise": {"master": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e"}, "mesh_data_resource": {"master": "4bda19b12be2c2a79a6121de6d22e48f3934e726"}, "procedural_animations": {"master": "9b1868668de4242ccc0565cf3c6b5e1c375f1576"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "fast_quadratic_mesh_simplifier": {"master": "0007d4793ef76b1998586018b66382b0fc8a9c99"}} \ No newline at end of file diff --git a/game/autoload/Entities.gd b/game/autoload/Entities.gd index 5931f13d..886f62f2 100644 --- a/game/autoload/Entities.gd +++ b/game/autoload/Entities.gd @@ -103,9 +103,10 @@ func load_player(file_name : String, position : Vector3, network_owner : int) -> createinfo.entity_player_type = EntityEnums.ENTITY_PLAYER_TYPE_PLAYER createinfo.serialized_data = load_file(file_name) createinfo.transform.origin = position + createinfo.networked = false Logger.info("Player spawned ") EntityDataManager.request_entity_spawn(createinfo) - + return createinfo.created_entity func spawn_player_for_menu(class_id : int, name : String, parent : Node) -> Entity: diff --git a/game/scenes/CharacterSelectorMenu.gd b/game/scenes/CharacterSelectorMenu.gd index da4bbf03..020a67da 100644 --- a/game/scenes/CharacterSelectorMenu.gd +++ b/game/scenes/CharacterSelectorMenu.gd @@ -157,6 +157,6 @@ func character_selection_changed() -> void: return for e in player_display_container_node.get_children(): - e.hide() + e.get_body().hide() b.entity.show() diff --git a/game/voxelman/world/TVVoxelChunk.gd b/game/voxelman/world/TVVoxelChunk.gd index 80224aeb..431d8955 100644 --- a/game/voxelman/world/TVVoxelChunk.gd +++ b/game/voxelman/world/TVVoxelChunk.gd @@ -254,7 +254,7 @@ func _build_phase(phase): # var fqms : FastQuadraticMeshSimplifier = FastQuadraticMeshSimplifier.new() # fqms.initialize(arr) # fqms.simplify_mesh(0.5) -# fqms.enable_smart_link = false +# fqms.enable_smart_link = true # fqms.preserve_border_dges = true # fqms.preserve_uv_seam_edges = true # var arr2 = fqms.get_arrays() @@ -263,12 +263,12 @@ func _build_phase(phase): ## print(arr[VisualServer.ARRAY_VERTEX].size()) ## print(arr2[VisualServer.ARRAY_VERTEX].size()) # -# var imgeom : ImmediateGeometry = get_child(0) as ImmediateGeometry -# imgeom.begin(Mesh.PRIMITIVE_POINTS) -# var vs = arr2[VisualServer.ARRAY_VERTEX] -# for v in vs: -# imgeom.add_vertex(v) -# imgeom.end() +## var imgeom : ImmediateGeometry = get_child(0) as ImmediateGeometry +## imgeom.begin(Mesh.PRIMITIVE_POINTS) +## var vs = arr2[VisualServer.ARRAY_VERTEX] +## for v in vs: +## imgeom.add_vertex(v) +## imgeom.end() # # # VisualServer.mesh_add_surface_from_arrays(get_mesh_rid(), VisualServer.PRIMITIVE_TRIANGLES, arr2) diff --git a/game/voxelman/world/TVVoxelMesher.gd b/game/voxelman/world/TVVoxelMesher.gd index 99e05628..ac7d4c5b 100644 --- a/game/voxelman/world/TVVoxelMesher.gd +++ b/game/voxelman/world/TVVoxelMesher.gd @@ -224,11 +224,11 @@ func n_add_chunk(b : Node) -> void: var surface1 : VoxelSurface = library.get_voxel_surface(type_id1) var surface2 : VoxelSurface = library.get_voxel_surface(type_id2) - if type_id1 == 0: - print(type_id1) - - if type_id2 == 0: - print("asd" + str(type_id2)) +# if type_id1 == 0: +# print(type_id1) +# +# if type_id2 == 0: +# print("asd" + str(type_id2)) for i in range(vertex_count): var fv : int = get_regular_vertex_data_first_vertex(case_code, i) diff --git a/game/voxelman/world/TVVoxelWorld.gd b/game/voxelman/world/TVVoxelWorld.gd index 55fa02a3..8b1311a5 100644 --- a/game/voxelman/world/TVVoxelWorld.gd +++ b/game/voxelman/world/TVVoxelWorld.gd @@ -244,7 +244,7 @@ func load_character(file_name : String) -> void: _player = Entities.load_player(file_name, Vector3(5, 30, 5), 1) as Entity #TODO hack, do this properly _player.set_physics_process(false) - + Server.sset_seed(_player.sseed) if level_generator != null: