There are actually two pieces to this puzzle.
Does me wearing a mask prevent me from getting the virus if you have the virus and are not wearing a mask? I think, probably not.
If you have the virus and are wearing a mask, are you less likely to transmit to me (me wearing a mask or not)? I think, probably yes.
You missed the third piece of the puzzle - if neither of us have the virus, what is the difference in protection between either or both of us wearing a mask, or none of us wearing a mask?