Remove useless codes in ai.cpp