Maximilian's direct heir was his distant cousin Count Palatine and Prince-Elector Charles Theodore (1724–1799), by prior succession agreements between the Bavarian and Palatinate branches of the Wittelsbach dynasty. Charles Theodore was amenable to an agreement with Emperor Joseph II that would allow him to acquire parts of the Austrian Netherlands in exchange for parts of his Bavarian inheritance. From 16 January 1778 Austrian troops moved into the Lower Bavarian lands of Straubing. Ultimately, both parties envisioned a wholesale exchange of the Bavarian lands for the Austrian Netherlands, but the final details were never concluded by treaty due to outside intervention.