Skip to content
Permalink
Browse files

Don't add damage flash while punch texture modifier is active (#5767)

  • Loading branch information...
stujones11 authored and nerzhul committed May 29, 2017
1 parent ef15242 commit 1681a009bc54b19eeab0356c7ed856bc0bed6a1a
Showing with 7 additions and 5 deletions.
  1. +7 −5 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;

0 comments on commit 1681a00

Please sign in to comment.
You can’t perform that action at this time.