Skip to content
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

Do not process vision for remote players when they are between dungeon levels #7755

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

StephenCWills
Copy link
Member

When the remote player transitions from their current level to the loading screen, the local client...

  • Receives CMD_NEWLVL
  • Calls player.setLevel() to update player.plrlevel
  • Sets player._pLvlChanging to true

When the remote player transitions from the loading screen to their new level, the local client...

  • Receives CMD_PLAYER_JOINLEVEL
  • Sets player._pLvlChanging to false
  • Calls StartStand() which calls FixPlayerLocation() to update the player's position
  • Calls ActivateVision() on the remote player instance

When the local player transitions from their current level to the loading screen after processing CMD_NEWLVL but before processing CMD_PLAYER_JOINLEVEL, the player.isOnActiveLevel() function will return true for the remote player because player.setLevel() was already called, but the remote player's location won't have been updated because FixPlayerLocation() hasn't been called.

This means that when LoadGameLevelLightVision() calls ProcessVisionList(), it will call DoVision() on the remote player in the wrong location. Since we know the local client will eventually call ActivateVision() on the remote player instance when CMD_PLAYER_JOINLEVEL is processed, it's okay to keep the remote player's vision deactivated while player._pLvlChanging is true.

This resolves #7745

@AJenbo AJenbo merged commit b9d79b4 into diasurgical:master Feb 14, 2025
22 checks passed
@StephenCWills StephenCWills deleted the fix-load-vision branch February 14, 2025 13:57
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.

[Issue Report]: Map reveal/monster activation bug
2 participants