Skip to content

Commit

Permalink
allow indestructible cells only to be in ready state
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Dec 4, 2024
1 parent fcb8b22 commit 3f4b6a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/EngineGpuKernels/CellProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 3f4b6a4

Please sign in to comment.