If there was an illness of continuous passing gas without an intermission of pause that allows a person to do wodhu and pray, then one can do the wodhu and pray and ignore any gases passed during the Salaat.
However, if a person have some intermittent time or a pause in which the gases stop and that pause was enough to do wodhu and pray limiting on the wajibaat then one must choose that time to pray as long as that pause is not out of the time range of the Salaat.