From 63556217b38fcb1155da4c5e9a8f8034bd1c84fd Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Fri, 21 Jul 2023 22:42:38 -0400 Subject: [PATCH] Don't regain breath while in ignore node * backported https://github.com/minetest/minetest/pull/8218 * Fixed the issue of Player regains a little breath when rejoining game into ignore --- src/content_sao.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 3d1b3fa9c..424885e62 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -940,8 +940,9 @@ void PlayerSAO::step(float dtime, bool send_recommended) v3s16 p = floatToInt(m_base_position + v3f(0, BS * 1.6, 0), BS); MapNode n = m_env->getMap().getNodeNoEx(p); const ContentFeatures &c = m_env->getGameDef()->ndef()->get(n); - // If player is alive & no drowning, breath - 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); }