diff options
author | stujones11 <stujones111@gmail.com> | 2017-05-29 22:26:25 +0100 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-05-29 23:26:25 +0200 |
commit | 1681a009bc54b19eeab0356c7ed856bc0bed6a1a (patch) | |
tree | a36f1539fe01dfef4f08cb18d19e70945e364a2d /src | |
parent | ef152428ef6ac609d805c4519b2247556db44931 (diff) | |
download | minetest-1681a009bc54b19eeab0356c7ed856bc0bed6a1a.tar.gz minetest-1681a009bc54b19eeab0356c7ed856bc0bed6a1a.tar.bz2 minetest-1681a009bc54b19eeab0356c7ed856bc0bed6a1a.zip |
Don't add damage flash while punch texture modifier is active (#5767)
Diffstat (limited to 'src')
-rw-r--r-- | src/content_cao.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp index 5690ecf1e..d15c53e7a 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -1735,7 +1735,7 @@ void GenericCAO::processMessage(const std::string &data) m_smgr, m_env, m_position, m_prop.visual_size * BS); m_env->addSimpleObject(simple); - } else { + } else if (m_reset_textures_timer < 0) { // TODO: Execute defined fast response // Flashing shall suffice as there is no definition m_reset_textures_timer = 0.05; @@ -1806,10 +1806,12 @@ bool GenericCAO::directReportPunch(v3f dir, const ItemStack *punchitem, } // TODO: Execute defined fast response // Flashing shall suffice as there is no definition - m_reset_textures_timer = 0.05; - if(result.damage >= 2) - m_reset_textures_timer += 0.05 * result.damage; - updateTextures(m_current_texture_modifier + "^[brighten"); + if (m_reset_textures_timer < 0) { + m_reset_textures_timer = 0.05; + if (result.damage >= 2) + m_reset_textures_timer += 0.05 * result.damage; + updateTextures(m_current_texture_modifier + "^[brighten"); + } } return false; |