Skip to content

Commit

Permalink
Limit movement fov
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Dec 27, 2023
1 parent 24362f8 commit 382be16
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/client/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 tool_reload_ratio)
auto fov_was = m_draw_control.fov_add;
m_draw_control.fov_add = speed.dotProduct(m_camera_direction)/(BS*4);
if (m_draw_control.fov_add > fov_was + 1)
m_draw_control.fov_add = fov_was + ( m_draw_control.fov_add - fov_was) / 3;
m_draw_control.fov_add = std::max<float>(10.0,fov_was + ( m_draw_control.fov_add - fov_was) / 3);
else if (m_draw_control.fov_add < fov_was - 1)
m_draw_control.fov_add = fov_was - (fov_was - m_draw_control.fov_add) / 3;
m_curr_fov_degrees -= m_draw_control.fov_add;
Expand Down
3 changes: 0 additions & 3 deletions src/client/clientmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ class ClientMap : public Map, public scene::ISceneNode

void renderPostFx(CameraMode cam_mode);

// For debugging the status and position of MapBlocks
void renderBlockBoundaries(const std::map<v3pos_t, MapBlock*> & blocks);

// For debug printing
void PrintInfo(std::ostream &out) override;

Expand Down
2 changes: 1 addition & 1 deletion util/autotest/auto.pl
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ ()
++$g->{keep_config};
$config->{runner} =
$config->{runner}
. ' ASAN_OPTIONS=abort_on_error=1 '
. ' env ASAN_OPTIONS=abort_on_error=1 '
. $config->{gdb}
. q{ -ex 'run' -ex 't a a bt' }
. ($config->{gdb_stay} ? '' : q{ -ex 'cont' -ex 'quit' })
Expand Down

0 comments on commit 382be16

Please sign in to comment.