void Army::Move( Logic& l, float delta_time, int& i ) { if( to == final_to ) { for( int j(0); j < l.GetArmies().size(); j++ ) { Army& a( l.GetArmyByIndex(j) ); if( a.used && i != j && x == a.x && y == a.y ) { soldiers += a.soldiers; carts += a.carts; rectangles[ (int)Type::Army ].erase( a.rectangle ); l.GetArmies().erase( j ); break; } } from = to; state = Stationary; } else { from = to; to = l.CalculatePathTo( *this, final_to ); } }