Skip to content
Permalink
Browse files

Don't regain breath while in ignore node (#8218)

* Don't regain breath while in ignore node

Fixes #8217
  • Loading branch information...
Wuzzy2 authored and nerzhul committed Feb 15, 2019
1 parent f290d01 commit 88c68ce8ec79bd5ce60d11fb4a09df1adc720d2f
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/content_sao.cpp
@@ -1014,8 +1014,9 @@ void PlayerSAO::step(float dtime, bool send_recommended)
v3s16 p = floatToInt(getEyePosition(), BS);
MapNode n = m_env->getMap().getNodeNoEx(p);
const ContentFeatures &c = m_env->getGameDef()->ndef()->get(n);
// If player is alive & no drowning, breathe
if (m_hp > 0 && m_breath < m_prop.breath_max && c.drowning == 0)
// If player is alive & no drowning & not in ignore, breathe
if (m_breath < m_prop.breath_max &&
c.drowning == 0 && n.getContent() != CONTENT_IGNORE && m_hp > 0)
setBreath(m_breath + 1);
}

0 comments on commit 88c68ce

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