Fixed Pass-by-value error in attack function.