fix gathering state mess
This commit is contained in:
parent
d9f3216793
commit
bd7e67e6b0
@ -50,6 +50,10 @@ window/stretch/aspect="expand"
|
|||||||
mouse_cursor/custom_image="res://assets/textures/gui/cursor.png"
|
mouse_cursor/custom_image="res://assets/textures/gui/cursor.png"
|
||||||
mouse_cursor/custom_image_hotspot=Vector2(32, 32)
|
mouse_cursor/custom_image_hotspot=Vector2(32, 32)
|
||||||
|
|
||||||
|
[editor]
|
||||||
|
|
||||||
|
movie_writer/movie_file="E:/Projects/Games/tli/build/recording.avi"
|
||||||
|
|
||||||
[filesystem]
|
[filesystem]
|
||||||
|
|
||||||
import/fbx2gltf/enabled=false
|
import/fbx2gltf/enabled=false
|
||||||
|
|||||||
@ -149,6 +149,10 @@ func _pick_up() -> void:
|
|||||||
_unit.animation_playback.travel("plop_down")
|
_unit.animation_playback.travel("plop_down")
|
||||||
|
|
||||||
await get_tree().create_timer(_pickup_interval).timeout
|
await get_tree().create_timer(_pickup_interval).timeout
|
||||||
|
|
||||||
|
if state == State.STOP:
|
||||||
|
return
|
||||||
|
|
||||||
var nearest := _find_nearest(_nearby_items.values())
|
var nearest := _find_nearest(_nearby_items.values())
|
||||||
if _carrying_items.size() == _max_carrying or nearest == null:
|
if _carrying_items.size() == _max_carrying or nearest == null:
|
||||||
_go_deposit()
|
_go_deposit()
|
||||||
@ -158,7 +162,6 @@ func _pick_up() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _deposit() -> void:
|
func _deposit() -> void:
|
||||||
await get_tree().create_timer(0.5).timeout
|
|
||||||
while _carrying_items.size() > 0:
|
while _carrying_items.size() > 0:
|
||||||
if state != State.DEPOSITING:
|
if state != State.DEPOSITING:
|
||||||
return
|
return
|
||||||
@ -182,6 +185,9 @@ func _deposit() -> void:
|
|||||||
_unit.anthill.deposit_honeydew(1)
|
_unit.anthill.deposit_honeydew(1)
|
||||||
await get_tree().create_timer(_drop_interval).timeout
|
await get_tree().create_timer(_drop_interval).timeout
|
||||||
|
|
||||||
|
if state == State.STOP:
|
||||||
|
return
|
||||||
|
|
||||||
var nearest := _find_nearest(_nearby_items.values())
|
var nearest := _find_nearest(_nearby_items.values())
|
||||||
if nearest == null:
|
if nearest == null:
|
||||||
state = State.WAITING_FOR_NEW_ITEMS
|
state = State.WAITING_FOR_NEW_ITEMS
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user