fix: empty-path re-entrancy, retry_count reset, := to = for Variant

This commit is contained in:
2026-07-03 18:51:13 +02:00
parent c6033b63fb
commit 41bfc8d90a
9 changed files with 2449 additions and 4 deletions
+6
View File
@@ -28,6 +28,8 @@ var task_duration := 0.0
var task_progress := 0.0
var task_complete := true
var target_id: StringName = &""
var retry_count := 0
var last_task := ""
func _init(
_id: int,
@@ -227,6 +229,9 @@ func calculate_task_score(
if profession == preferred_profession:
score += 2.0
if task_name == last_task:
score -= 1.5
score += randf_range(0.0, 0.5)
if DEBUG_LOGS:
@@ -242,6 +247,7 @@ func calculate_task_score(
return score
func set_task(task: String, duration: float) -> void:
last_task = current_task
current_task = task
task_duration = duration
task_progress = 0.0