diff options
author | Wuzzy <wuzzy2@mail.ru> | 2019-02-15 12:22:30 +0100 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2019-02-15 12:22:30 +0100 |
commit | 88c68ce8ec79bd5ce60d11fb4a09df1adc720d2f (patch) | |
tree | c96dfb4eed83f64c1b7f0d6db93b947dcf0804b2 | |
parent | f290d01abe89029d252042a7f0805aef353a63c6 (diff) | |
download | minetest-88c68ce8ec79bd5ce60d11fb4a09df1adc720d2f.tar.gz minetest-88c68ce8ec79bd5ce60d11fb4a09df1adc720d2f.tar.bz2 minetest-88c68ce8ec79bd5ce60d11fb4a09df1adc720d2f.zip |
Don't regain breath while in ignore node (#8218)
* Don't regain breath while in ignore node
Fixes #8217
-rw-r--r-- | src/content_sao.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp index e0374d28d..cb0a969eb 100644 --- a/src/content_sao.cpp +++ b/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); } |