Skip to content

Commit

Permalink
Don't add damage flash while punch texture modifier is active (#5767)
Browse files Browse the repository at this point in the history
  • Loading branch information
stujones11 authored and nerzhul committed May 29, 2017
1 parent ef15242 commit 1681a00
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/content_cao.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1681a00

Please sign in to comment.