When that prince was defeated at Delhi by the Mahrattas, Madec rejoined his own countrymen in Puducherry, where he took an active part in the defence of the town (1778).