@Override
	protected void processWindowEvent(WindowEvent event) {
		try {
			if (event.getID() == WindowEvent.WINDOW_CLOSING) { //Quicksave the game if the window closes.
				if (doesCurrentMatchNeedSaving()) {
					new MatchSaveData(currentMatch).quicksave();
				}
			}
		} catch (Exception exception) {
			exception.printStackTrace();
			System.exit(0); //If anything unexpected happens here, forget the quicksave and just quit.
			//We don't want the program freezing on exit.
		}
		super.processWindowEvent(event);
	}