Skip to content

Commit

Permalink
Worldmap Tux icon animation handling improvements (#1690)
Browse files Browse the repository at this point in the history
Co-authored-by: Semphris <[email protected]>
  • Loading branch information
Semphriss and Semphris authored Apr 27, 2021
1 parent 9b98f7a commit c6c3e28
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/worldmap/tux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,20 @@ Tux::draw(DrawingContext& context)
{
if (m_moving && (get_axis().x != 0 || get_axis().y != 0))
{
if(m_worldmap->get_savegame().get_player_status().worldmap_sprite == "/images/worldmap/common/swim.sprite")
std::string direct = "-up";
if (get_axis().x == 1) direct = "-right";
if (get_axis().x == -1) direct = "-left";
if (get_axis().y == 1) direct = "-up";
if (get_axis().y == -1) direct = "-down";
if (m_sprite->has_action(action + "-walking" + direct))
{
std::string direct = "-up";
if (get_axis().x == 1) direct = "-right";
if (get_axis().x == -1) direct = "-left";
if (get_axis().y == 1) direct = "-up";
if (get_axis().y == -1) direct = "-down";

m_sprite->set_action(action + "-walking" + direct);
}
else
else if (m_sprite->has_action(action + "-walking"))
{
m_sprite->set_action(action + "-walking");
}
// else, keep the same animation that was already playing
}
else
{
Expand Down

0 comments on commit c6c3e28

Please sign in to comment.