Skip to content

SERVER: Ensure PlayerSpawn() only resets rounds when appropriate#132

Closed
tanuki-billie wants to merge 1 commit into
nzp-team:mainfrom
tanuki-billie:round-time-travel
Closed

SERVER: Ensure PlayerSpawn() only resets rounds when appropriate#132
tanuki-billie wants to merge 1 commit into
nzp-team:mainfrom
tanuki-billie:round-time-travel

Conversation

@tanuki-billie
Copy link
Copy Markdown
Contributor

Description of Changes


Adds an additional guard for rounds being updated in PlayerSpawn() so that rounds aren't erroneously reset when a player joins a multiplayer game (nzp-team/nzportable#1185). Also adds a relevant unit test in a file for round-specific logic.

Visual Sample


round.progression.trimmed.mp4

Checklist


  • I have thoroughly tested my changes to the best of my ability
  • I confirm I have not contributed anything that would impact Nazi Zombies: Portable's licensing and usage
  • This Pull Request fixes a critical issue that should be reviewed and merged as soon as possible

@tanuki-billie tanuki-billie changed the title SERVER: Ensure PlayerSpawn() only resets rounds when appropriate SERVER: Ensure PlayerSpawn() only resets rounds when appropriate Jun 25, 2025
Copy link
Copy Markdown
Member

@MotoLegacy MotoLegacy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor question and comment revision, otherwise LGTM

// This prevents the round resetting whenever a player joins the game.
// (https://github.com/nzp-team/nzportable/issues/1185)
//
void() Test_Round_PlayerSpawnSetsRoundProperly =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you confirm that this test functioned properly (failed) before writing your fix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I hadn't. The test still passes when the change is reverted. I'll need to go back and revise the test (and the code).

//
// Test_Round_PlayerSpawnSetsRoundProperly()
// Validate that PlayerSpawn() only sets the round when needed (at the game start).
// This prevents the round resetting whenever a player joins the game.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this line because this isn't fixing or preventing anything, just testing its behaviors

@tanuki-billie tanuki-billie marked this pull request as draft June 26, 2025 02:41
@tanuki-billie tanuki-billie closed this by deleting the head repository Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants