[main.cpp] Fixed errors in attack loop.