Skip to content
Open
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
12 changes: 10 additions & 2 deletions src/object/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2238,6 +2238,8 @@ Player::draw(DrawingContext& context)
const bool is_not_idle = std::all_of(IDLE_STAGES.begin(), IDLE_STAGES.end(),
[this](const std::string& stage) { return m_sprite->get_action().find("-" + stage + "-") == std::string::npos; });

std::string base_idle_action = sa_prefix + "-" + IDLE_STAGES[0] + sa_postfix;

if (is_not_idle || (m_should_fancy_idle && !m_fancy_idle_active) || m_reset_action)
{
m_idle_stage = 0;
Expand Down Expand Up @@ -2270,13 +2272,19 @@ Player::draw(DrawingContext& context)
else
set_action(sa_prefix + ("-" + IDLE_STAGES[m_idle_stage]) + sa_postfix, 1);
}
else if(m_sprite->get_action() != base_idle_action)
{
m_idle_stage = 0;
set_action(base_idle_action);
m_sprite->set_animation_loops(-1);
}
}
else
{
if (m_idle_stage != 0 || m_sprite->get_action() != sa_prefix + ("-" + IDLE_STAGES[0]) + sa_postfix)
if (m_idle_stage != 0 || m_sprite->get_action() != base_idle_action)
{
m_idle_stage = 0;
set_action(sa_prefix + ("-" + IDLE_STAGES[0]) + sa_postfix);
set_action(base_idle_action);
m_sprite->set_animation_loops(-1);
}
m_fancy_idle_active = false;
Expand Down