Skip to content

Commit 1681a00

Browse files
stujones11nerzhul
authored andcommittedMay 29, 2017
Don't add damage flash while punch texture modifier is active (#5767)
1 parent ef15242 commit 1681a00

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
 

‎src/content_cao.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@ void GenericCAO::processMessage(const std::string &data)
17351735
m_smgr, m_env, m_position,
17361736
m_prop.visual_size * BS);
17371737
m_env->addSimpleObject(simple);
1738-
} else {
1738+
} else if (m_reset_textures_timer < 0) {
17391739
// TODO: Execute defined fast response
17401740
// Flashing shall suffice as there is no definition
17411741
m_reset_textures_timer = 0.05;
@@ -1806,10 +1806,12 @@ bool GenericCAO::directReportPunch(v3f dir, const ItemStack *punchitem,
18061806
}
18071807
// TODO: Execute defined fast response
18081808
// Flashing shall suffice as there is no definition
1809-
m_reset_textures_timer = 0.05;
1810-
if(result.damage >= 2)
1811-
m_reset_textures_timer += 0.05 * result.damage;
1812-
updateTextures(m_current_texture_modifier + "^[brighten");
1809+
if (m_reset_textures_timer < 0) {
1810+
m_reset_textures_timer = 0.05;
1811+
if (result.damage >= 2)
1812+
m_reset_textures_timer += 0.05 * result.damage;
1813+
updateTextures(m_current_texture_modifier + "^[brighten");
1814+
}
18131815
}
18141816

18151817
return false;

0 commit comments

Comments
 (0)