Skip to content

Commit 6093eea

Browse files
committed
Compare cell pointer and not the index
1 parent 73acd59 commit 6093eea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/PhysiCell_cell.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3485,8 +3485,9 @@ void Cell::remove_self_from_attackers( void )
34853485
#pragma omp parallel for
34863486
for (int j=0; j < all_cells->size(); j++)
34873487
{
3488-
if (j != index && (*all_cells)[j]->phenotype.cell_interactions.pAttackTarget == this) {
3489-
(*all_cells)[j]->phenotype.cell_interactions.pAttackTarget = NULL;
3488+
Cell* pC = (*all_cells)[j];
3489+
if (( pC != this) && pC->phenotype.cell_interactions.pAttackTarget == this) {
3490+
pC->phenotype.cell_interactions.pAttackTarget = NULL;
34903491
}
34913492
}
34923493
}

0 commit comments

Comments
 (0)