Merge pull request #214 from limbonaut/fix-warnings

Fix loop variables used as copy
This commit is contained in:
Serhii Snitsaruk 2024-09-15 14:36:36 +02:00 committed by GitHub
commit 1ca1154cd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -869,7 +869,7 @@ void LimboAIEditor::_on_tasks_dragged(const TypedArray<BTTask> &p_tasks, Ref<BTT
// Remove all tasks first so adding ordering is stable.
int before_pos = 0;
for (const Ref<BTTask> task : tasks_list) {
for (const Ref<BTTask> &task : tasks_list) {
if (task->get_parent() == p_to_task && p_to_pos > task->get_index()) {
before_pos += 1;
}
@ -883,7 +883,7 @@ void LimboAIEditor::_on_tasks_dragged(const TypedArray<BTTask> &p_tasks, Ref<BTT
}
// Re-add tasks in later undo action so indexes match the old order.
for (const Ref<BTTask> task : tasks_list) {
for (const Ref<BTTask> &task : tasks_list) {
undo_redo->add_undo_method(task->get_parent().ptr(), LW_NAME(add_child_at_index), task, task->get_index());
}