Skip to content

Commit

Permalink
Merge pull request #78662 from Procyonae/FixPeekFalling
Browse files Browse the repository at this point in the history
Fix peeking out of windows causing you to fall
  • Loading branch information
Night-Pryanik authored Dec 21, 2024
2 parents 703ead1 + 1d0c989 commit 5ccd156
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 5ccd156

Please sign in to comment.