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

spectators can no longer move and attack with units after selecting them #7062

Merged
merged 2 commits into from
Jun 6, 2022

Conversation

ofetios
Copy link
Contributor

@ofetios ofetios commented Jun 3, 2022

No matter what I do Github makes it hard to read so:
I added

if (!UncivGame.Current.gameInfo.currentPlayerCiv.isSpectator()) { 
    //code 
}

on the code when you right click after selecting a unit as this caused many issues mentioned in #4460

@ofetios ofetios changed the title less power for spectators spectators can no longer move and attack with units after selecting them Jun 3, 2022
@SomeTroglodyte
Copy link
Collaborator

Oh, didn't see that issue when I did #7003. I think a if () return would be the better formatting.

Linking 4460 with "resolves" is a bit exaggerated - there's more loopholes listed there. Can't investigate the next week or so, but it sounds as if just a few more checks if () return might be in order - the difficulty being in finding how non-rightclick ensures the rules and to make sure these checks can "find each other" for the next coder coming along.

Copy link
Collaborator

@Azzurite Azzurite left a comment

Choose a reason for hiding this comment

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

The "correct" fix is to use the exact same code for attacking when using rightclick attack and "normal" attack... But yeah, like @SomeTroglodyte says, if you still want this in, please at least make it a if (...) return instead?

@ofetios
Copy link
Contributor Author

ofetios commented Jun 4, 2022

i reformatted but a correct fix would probably be better than this

Copy link
Collaborator

@Azzurite Azzurite left a comment

Choose a reason for hiding this comment

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

Still better than not having it :)

@yairm210 yairm210 merged commit 6c990b6 into yairm210:master Jun 6, 2022
@ofetios ofetios deleted the spectatorsCantRightClick2 branch June 10, 2022 11: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.

4 participants