Add rp_mobs.clear_task_queue

This commit is contained in:
Wuzzy 2024-04-03 17:40:48 +02:00
parent c0495ae719
commit 20a63f90a4
2 changed files with 7 additions and 0 deletions

View File

@ -716,6 +716,9 @@ Add the microtask `microtask` to the specified `task`. Will also initialize the
Ends the currently active task in the given `task_queue` of `mob`. Ends the currently active task in the given `task_queue` of `mob`.
If the task queue is empty, nothing happens. If the task queue is empty, nothing happens.
#### `rp_mobs.clear_task_queue(mob, task_queue)`
Remove all tasks in the given `task_queue`.

View File

@ -460,6 +460,10 @@ rp_mobs.end_current_task_in_task_queue = function(mob, task_queue)
end end
end end
rp_mobs.clear_task_queue = function(task_queue)
task_queue.tasks:removeAll()
end
rp_mobs.create_task = function(def) rp_mobs.create_task = function(def)
local task local task
if def then if def then