function convertCityOnCapture(oldPlayerID, capital, iX, iY, newPlayerID, conquest1, conquest2)
player = Players[newPlayerID];
// Make sure the conquer has the trait and has founded a religion
if(player == Civ with trait && player:GetReligionCreatedByPlayer() >= 1) then
// get the city object
city = Map.GetPlot(iX, iY).GetPlotCity();
city:AdoptReligionFully(player.GetReligionCreatedByPlayer());
end
end
GameEvents.CityCaptureComplete.add(convertCityOnCapture)