From 37ad0fd3cfb5b4c7040045d8e73ee4c1c0250442 Mon Sep 17 00:00:00 2001
From: Tim <wuzhiwei@galasports.com>
Date: Wed, 18 Oct 2023 10:45:12 +0800
Subject: [PATCH] Fix Boids MergeCell ExecuteNext bug

---
 EntitiesSamples/Assets/Boids/Scripts/BoidSystem.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/EntitiesSamples/Assets/Boids/Scripts/BoidSystem.cs b/EntitiesSamples/Assets/Boids/Scripts/BoidSystem.cs
index 8b8170ddf..396db2427 100644
--- a/EntitiesSamples/Assets/Boids/Scripts/BoidSystem.cs
+++ b/EntitiesSamples/Assets/Boids/Scripts/BoidSystem.cs
@@ -238,8 +238,8 @@ public void ExecuteFirst(int index)
             public void ExecuteNext(int cellIndex, int index)
             {
                 cellCount[cellIndex]      += 1;
-                cellAlignment[cellIndex]  += cellAlignment[cellIndex];
-                cellSeparation[cellIndex] += cellSeparation[cellIndex];
+                cellAlignment[cellIndex]  += cellAlignment[index];
+                cellSeparation[cellIndex] += cellSeparation[index];
                 cellIndices[index]        = cellIndex;
             }
         }