From 9d7b452a15a684b848ff5b00a64b9204a73d655c Mon Sep 17 00:00:00 2001 From: MatusGuy Date: Sat, 31 Aug 2024 19:43:29 +0100 Subject: [PATCH] play falling animation --- src/badguy/granito.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/badguy/granito.cpp b/src/badguy/granito.cpp index ca4093499fa..f7352564503 100644 --- a/src/badguy/granito.cpp +++ b/src/badguy/granito.cpp @@ -50,7 +50,7 @@ Granito::Granito(const ReaderMapping& reader, const std::string& sprite_name, in void Granito::active_update(float dt_sec) { - if (m_state == STATE_SIT || m_type == WALK) + if (m_state == STATE_SIT) { // Don't do any extra calculations WalkingBadguy::active_update(dt_sec); @@ -84,6 +84,14 @@ Granito::active_update(float dt_sec) } } + if (m_type == WALK) + { + // Don't do any extra calculations + WalkingBadguy::active_update(dt_sec); + m_stepped_on = false; + return; + } + if ((m_state == STATE_LOOKUP && !m_stepped_on) || (m_state == STATE_JUMPING && on_ground())) {