It is often necessary to refer to a person whose gender is unknown or irrelevant. In such cases, the plural pronoun they can be used.
Saving the game should allow the player to return to the real world when they need to.
Either of the personal pronouns she or he could also be used; sometimes she/he or he/she are used. The form s/he is generally considered less formal.
An alternative is to rewrite the sentence to avoid the pronoun.
Saving the game should allow the player to return to the real world when necessary.