To correctly answer your question I need to know in which state you are located, where were you married, how long are you living in the state, where does your spouse reside, are there any children, assets, etc. and where are they located?
In general, most states today do not consider the grounds for the divorce as material in determining the allocation of marital property or custodial control over the children. However, the court may take into consideration any facts which may indicate to the court the ability of a party to serve as a role model for the children and his/her ability to provide a positive environment in which to raise the children.
Therefore, in general, I would say that based on the limited facts which you have provided above, your rights regarding the division of marital property should not be affected by your marital affair. If there are children involved, there custody and control will depend on the subjective decision of the court.