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

Fix 4670: Hide entity statblocks from the hex tooltip when entity is hidden #5171

Conversation

Sleet01
Copy link
Collaborator

@Sleet01 Sleet01 commented Feb 15, 2024

Makes adding the entity statblocks conditional on whether they are visible to the current local player; previously they were added unconditionally, even if the entity were hidden. Double Blind did hide this information, but through a different mechanism.

Testing:

  • Tested with two bot forces starting hidden, with and without Double Blind, with and without GM mode.
  • Ran existing MM unit tests.

Close #4670

StringBuffer sbEntity = new StringBuffer();
appendEntityTooltip(sbEntity, entity);
result += sbEntity.toString();
if (EntityVisibilityUtils.detectedOrHasVisual(localPlayer, game, entity)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry for the format spam; this is the actual change in this file.

@HammerGS HammerGS merged commit fe0c7d1 into MegaMek:master Feb 16, 2024
4 checks passed
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.

[49.13] Mousing over hexes can reveal hidden units
3 participants