The error may not be in that block, and I don't know specifically what your variables are, but based on my understanding, anthonytrappedcell should not be True in those circumstances. The PC may think he is, but he's not. That said, I am way newer at Python than you are :P