Don't regain breath while in ignore node (#8218)
authorWuzzy <wuzzy2@mail.ru>
Fri, 15 Feb 2019 11:22:30 +0000 (12:22 +0100)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Fri, 15 Feb 2019 11:22:30 +0000 (12:22 +0100)
* Don't regain breath while in ignore node

Fixes #8217

src/content_sao.cpp

index e0374d28d15554f49d034ae1ff2e0a08903aa4da..cb0a969ebb61d9640217e598198f51e35e48d456 100644 (file)
@@ -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);
        }