Italy joins in exchange for Rome, Gorizia, and guaranteed close ties with France in the future. Austria-Hungary joins France to fight the Prussians again, and gives Gorizia to Italy to secure their flank. This happens around the beginning of the war, when France started to loose.