Skip to content

Commit

Permalink
Fix camera following tux when dying (SuperTux#2807)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miner34dev authored Mar 6, 2024
1 parent 7a44bfd commit 6158e96
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/object/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,16 @@ Camera::update(float dt_sec)

switch (m_mode) {
case Mode::NORMAL:
if (Sector::current() && Sector::current()->get_object_count<Player>() > 1)
if (Sector::current())
{
update_scroll_normal_multiplayer(dt_sec);
}
else
{
update_scroll_normal(dt_sec);
if (Sector::current()->get_object_count<Player>() > 1)
{
update_scroll_normal_multiplayer(dt_sec);
}
else if (!(Sector::current()->get_players()[0]->is_dying()))
{
update_scroll_normal(dt_sec);
}
}
break;
case Mode::MANUAL:
Expand Down

0 comments on commit 6158e96

Please sign in to comment.