Actual contents of f2ac08f7. Not sure how I managed to mess up like this.

This commit is contained in:
Relintai 2020-03-04 18:47:20 +01:00
parent 08e66baac0
commit 3081388a79
3 changed files with 15 additions and 22 deletions

2
HEADS
View File

@ -1 +1 @@
{"engine": {"3.2": "0d5e483a90c41c433056b8cf6e4e8def6316690f", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "a08917370cdef0884042bdb49fb80ece0b2e76ec"}, "entity_spell_system": {"master": "3e10779dbc5258d1e1b08eab287189f9c1ccec64"}, "ui_extensions": {"master": "38acc650db260a831dc26ca96fe9d9a087230bdc"}, "voxelman": {"master": "fbd2903477bc810fba8abec48f9cd6f9252e2fe5"}, "texture_packer": {"master": "b17c174906f84de93d84aa60d010ffe603efaa28"}, "fastnoise": {"master": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e"}, "mesh_data_resource": {"master": "4bda19b12be2c2a79a6121de6d22e48f3934e726"}, "procedural_animations": {"master": "ba464ef04500aa01b2638cf1f890f3f6582ead84"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}} {"engine": {"3.2": "0d5e483a90c41c433056b8cf6e4e8def6316690f", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "a08917370cdef0884042bdb49fb80ece0b2e76ec"}, "entity_spell_system": {"master": "3e10779dbc5258d1e1b08eab287189f9c1ccec64"}, "ui_extensions": {"master": "38acc650db260a831dc26ca96fe9d9a087230bdc"}, "voxelman": {"master": "59291a9417db2e1ba3a5fc5dc6ae2e8cdda1b09a"}, "texture_packer": {"master": "b17c174906f84de93d84aa60d010ffe603efaa28"}, "fastnoise": {"master": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e"}, "mesh_data_resource": {"master": "4bda19b12be2c2a79a6121de6d22e48f3934e726"}, "procedural_animations": {"master": "ba464ef04500aa01b2638cf1f890f3f6582ead84"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}}

View File

@ -51,6 +51,8 @@ var sleep : bool = false
var dead : bool = false var dead : bool = false
var death_timer : float = 0 var death_timer : float = 0
var _world : VoxelWorld = null
func _ready() -> void: func _ready() -> void:
animation_tree = get_character_skeleton().get_animation_tree() animation_tree = get_character_skeleton().get_animation_tree()
@ -60,27 +62,13 @@ func _ready() -> void:
animation_tree["parameters/run-loop/blend_position"] = Vector2(0, -1) animation_tree["parameters/run-loop/blend_position"] = Vector2(0, -1)
ai_state = EntityEnums.AI_STATE_PATROL ai_state = EntityEnums.AI_STATE_PATROL
set_process(true)
set_physics_process(true)
func _enter_tree(): func _enter_tree():
var world : VoxelWorld = get_node("..") as VoxelWorld _world = get_node("..") as VoxelWorld
if world != null:
if not world.is_position_walkable(get_body().transform.origin):
world.connect("chunk_mesh_generation_finished", self, "chunk_mesh_generation_finished", [], CONNECT_DEFERRED)
set_process(false)
set_physics_process(false)
func chunk_mesh_generation_finished(chunk):
var world : VoxelWorld = get_node("..") as VoxelWorld
if world.is_position_walkable(get_body().transform.origin):
world.disconnect("chunk_mesh_generation_finished", self, "chunk_mesh_generation_finished")
set_process(true)
set_physics_process(true)
set_process(true)
set_physics_process(true)
func _process(delta : float) -> void: func _process(delta : float) -> void:
if dead: if dead:
@ -90,6 +78,7 @@ func _process(delta : float) -> void:
queue_free() queue_free()
return return
var camera : Camera = get_tree().get_root().get_camera() as Camera var camera : Camera = get_tree().get_root().get_camera() as Camera
@ -118,7 +107,11 @@ func _physics_process(delta : float) -> void:
if dead: if dead:
return return
if _world != null:
if not _world.is_position_walkable(get_body().transform.origin):
return
process_movement(delta) process_movement(delta)
func process_movement(delta : float) -> void: func process_movement(delta : float) -> void:

View File

@ -96,9 +96,9 @@ func generate_terrarin(chunk : VoxelChunk, spawn_mobs: bool) -> void:
# chunk.build() # chunk.build()
if not Engine.editor_hint and chunk.position_y == 0 and spawn_mobs: if not Engine.editor_hint and chunk.position_y == 0 and spawn_mobs:
Entities.spawn_mob(1, randi() % 3, Vector3(chunk.position_x * chunk.size_x * chunk.voxel_scale - chunk.size_x / 2,\ Entities.spawn_mob(1, randi() % 3, Vector3(chunk.position_x * chunk.size_x * chunk.voxel_scale + chunk.size_x / 2,\
(chunk.position_y + 1) * chunk.size_y * chunk.voxel_scale, \ (chunk.position_y + 1) * chunk.size_y * chunk.voxel_scale, \
chunk.position_z * chunk.size_z * chunk.voxel_scale - chunk.size_z / 2)) chunk.position_z * chunk.size_z * chunk.voxel_scale + chunk.size_z / 2))
func box_blur(chunk : VoxelChunk): func box_blur(chunk : VoxelChunk):
for x in range(0, chunk.size_x): for x in range(0, chunk.size_x):