Skip to content

Commit

Permalink
Don't regain breath while in ignore node
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuzzy2 committed Feb 10, 2019
1 parent a809f73 commit 2838bf1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/content_sao.cpp
Expand Up @@ -1015,9 +1015,11 @@ void PlayerSAO::step(float dtime, bool send_recommended)
// Get nose/mouth position, approximate with eye position
v3s16 p = floatToInt(getEyePosition(), BS);
MapNode n = m_env->getMap().getNodeNoEx(p);
content_t content = n.getContent();
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 (content != CONTENT_IGNORE && m_hp > 0 &&
m_breath < m_prop.breath_max && c.drowning == 0)
setBreath(m_breath + 1);
}

Expand Down

0 comments on commit 2838bf1

Please sign in to comment.