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 blind throw while peeking up/downstairs #49014

Conversation

Zeropol
Copy link
Contributor

@Zeropol Zeropol commented May 24, 2021

Summary

Bugfixes "Fix blind throw while peeking up/downstairs"

Purpose of change

To fix #49009
We were only able to look around when peeking upstairs or downstairs because game::peek() function in

void game::peek()
did not call game::peek( const tripoint &p ) when a z lvl move was detected, and instead call look_around() with no support for peeking.

Describe the solution

Remove look_around() handling in game::peek() when there is a z-lvl move, and let game::peek( const tripoint &p ) handle this.

Describe alternatives you've considered

Merging game::peek() and game::peek( const tripoint &p )

Testing

Done so far :

  • peeking without changing z-lvl, then blind throw.
  • peeking with a forbidden z-lvl change ( no stairs ) -> you can't climb there / You can't go down there.
  • peeking upstairs ( ladder ), then cancel.
  • peeking upstairs, then blind throw.
  • peeking downstairs, then cancel. Peeking downstairs, then blind throw.
  • peeking without changing z-lvl, then blind throw aiming z-lvl+1 through a solid floor. ( The interface looked like a normal throw through z-lvl )
  • peeking upstairs, then blind throw aiming aiming z-lvl+1 through a solid floor. ( So aiming 2 z-lvl above what was the player position before peeking )
    The last two test were to make sure we can't throw at a position we should not be able to.

To do :

Additional context

I would love someone to double check I did not broke anything or/and propose more tests for me to do before this is merged.
The player avatar do weird "blink" moves during the blind throw, but they were already present before this PR. ( example, if we peek left, select blind throw, the player get back to its previous position to select the item to throw, then get teleported back to peeking position then we aim and throw )

We were only able to look around when peeking upstairs or downstairs because peek() did not called peek(tripoint) when a z lvl move was detected.
@Zeropol Zeropol changed the title Fix ability to blind throw while peeking up/downstairs Fix blind throw while peeking up/downstairs May 24, 2021
@actual-nh actual-nh added <Bugfix> This is a fix for a bug (or closes open issue) Mechanics: Aiming Aiming, especially aiming balance Z-levels Levels below and above ground. labels May 24, 2021
@ZhilkinSerg ZhilkinSerg merged commit 72ffb5b into CleverRaven:master May 28, 2021
@Zeropol Zeropol deleted the fix-blind-throw-while-going-upstairs-or-down branch May 28, 2021 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) Mechanics: Aiming Aiming, especially aiming balance Z-levels Levels below and above ground.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't throw blind while peeking upstairs/downstairs
3 participants