because you are in a loop it is mean that you remove the entity.but in next loop the statement still use the "me",but "me" is NULL at all. so it cause the empty pointer.

my upstairs give you a solution A
i give you a solution B:
if (HIT_TARGET)
{
ent_remove(my);
return; //return NOW!!!
}

well, my English is poor .i hope that you can know what i say


Full of my eyes are class struggles.....