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 peeking out of windows causing you to fall #78662

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/avatar_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ void avatar_action::plthrow( avatar &you, item_location loc,
// otherwise see.
const tripoint_bub_ms original_player_position = you.pos_bub();
if( blind_throw_from_pos ) {
you.setpos( *blind_throw_from_pos );
you.setpos( *blind_throw_from_pos, false );
}

g->temp_exit_fullscreen();
Expand All @@ -1071,7 +1071,7 @@ void avatar_action::plthrow( avatar &you, item_location loc,

// If we previously shifted our position, put ourselves back now that we've picked our target.
if( blind_throw_from_pos ) {
you.setpos( original_player_position );
you.setpos( original_player_position, false );
}

if( trajectory.empty() ) {
Expand Down
4 changes: 2 additions & 2 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6308,7 +6308,7 @@ void game::peek( const tripoint_bub_ms &p )
{
u.mod_moves( -u.get_speed() * 2 );
tripoint_bub_ms prev = u.pos_bub();
u.setpos( p );
u.setpos( p, false );
const bool is_same_pos = u.pos_bub() == prev;
const bool is_standup_peek = is_same_pos && u.is_crouching();
tripoint_bub_ms center = p;
Expand All @@ -6323,7 +6323,7 @@ void game::peek( const tripoint_bub_ms &p )
u.activate_crouch_mode();
} else { // Else is normal peek
result = look_around( looka_params );
u.setpos( prev );
u.setpos( prev, false );
}

if( result.peek_action ) {
Expand Down
Loading