diff --git a/source/EngineGpuKernels/CellProcessor.cuh b/source/EngineGpuKernels/CellProcessor.cuh index 27c08d775..2f222a753 100644 --- a/source/EngineGpuKernels/CellProcessor.cuh +++ b/source/EngineGpuKernels/CellProcessor.cuh @@ -626,7 +626,9 @@ __inline__ __device__ void CellProcessor::livingStateTransition_calcNextState(Si auto origLivingState = cell->livingState; auto livingState = origLivingState; - if (origLivingState == LivingState_Activating) { + if (cell->barrier) { + livingState = LivingState_Ready; + } else if (origLivingState == LivingState_Activating) { livingState = LivingState_Ready; if (cudaSimulationParameters.features.cellAgeLimiter && cudaSimulationParameters.cellResetAgeAfterActivation) { atomicExch(&cell->age, 0); @@ -668,9 +670,7 @@ __inline__ __device__ void CellProcessor::livingStateTransition_applyNextState(S for (int index = partition.startIndex; index <= partition.endIndex; ++index) { auto& cell = cells.at(index); - if (!cell->barrier) { - cell->livingState = cell->tag; - } + cell->livingState = cell->tag; cell->tag = 0; } }