-
Notifications
You must be signed in to change notification settings - Fork 450
fix: spawning new player does not remove previous #1779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: spawning new player does not remove previous #1779
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like some more comments in the test and have the test named more self-describingly
[UnityTest] | ||
public IEnumerator SpawnAnotherPlayerObject() | ||
{ | ||
var originalPlayer = m_PlayerNetworkObjects[1][1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to rationalize to myself that I should know why I am looking this up by [1][1]. Worth a comment to explain.
} | ||
|
||
[UnityTest] | ||
public IEnumerator SpawnAnotherPlayerObject() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would title this "TestReplacementPlayerObjectCleanup" or similar. "SpawnAnotherPlayerObject", if I'm coming in cold, just tells me we are testing spawning yet another PlayerObject - a title that specifically conveys that you are checking that old player objects are de-player-ified will help future generations
Spawning a new player object with SpawnAsPlayerObject does not set the IsPlayerObject property of the previous player object to false allowing for multiple player objects which shouldn't be the case.
MTT-1570
Changelog
com.unity.netcode.gameobjects
-Fixed: issue when spawning new player if an already existing player exists it does not remove IsPlayer from the previous player.
Testing and Documentation