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
This commit is contained in:
parent
209f31601d
commit
23d8b837f4
@ -938,8 +938,8 @@ 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 < PLAYER_MAX_BREATH && 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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user