AIPlayer trigger fix as in #1007

Check against the right constant, and use an unsigned int for looping.