Fixed the problem with attack. Territories must be passed by reference when they are parameters for a function.