From ff98daf77607903841d7aa7b1c43037dca527584 Mon Sep 17 00:00:00 2001 From: Christian Heinemann Date: Wed, 25 Oct 2023 23:41:23 +0200 Subject: [PATCH] endless detonation bug fixed --- source/EngineGpuKernels/CellFunctionProcessor.cuh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/EngineGpuKernels/CellFunctionProcessor.cuh b/source/EngineGpuKernels/CellFunctionProcessor.cuh index 95f58952e..7e81720c9 100644 --- a/source/EngineGpuKernels/CellFunctionProcessor.cuh +++ b/source/EngineGpuKernels/CellFunctionProcessor.cuh @@ -37,10 +37,10 @@ __inline__ __device__ void CellFunctionProcessor::collectCellFunctionOperations( auto executionOrderNumber = toInt(data.timestep % cudaSimulationParameters.cellNumExecutionOrderNumbers); for (int index = partition.startIndex; index <= partition.endIndex; ++index) { auto& cell = cells.at(index); - if (cell->cellFunction != CellFunction_None && cell->executionOrderNumber == executionOrderNumber && cell->activationTime == 0) { + if (cell->cellFunction != CellFunction_None && cell->executionOrderNumber == executionOrderNumber) { if (cell->cellFunction == CellFunction_Detonator && cell->cellFunctionData.detonator.state == DetonatorState_Activated) { data.cellFunctionOperations[cell->cellFunction].tryAddEntry(CellFunctionOperation{cell}); - } else if (cell->livingState == LivingState_Ready) { + } else if (cell->livingState == LivingState_Ready && cell->activationTime == 0) { data.cellFunctionOperations[cell->cellFunction].tryAddEntry(CellFunctionOperation{cell}); } }