Skip to content

Commit

Permalink
Do not increase breath if at full breath.
Browse files Browse the repository at this point in the history
Prevents the server from sending TOCLIENT_BREATH packets
every 0.5seconds, if there is no reason to.
  • Loading branch information
sofar committed Mar 12, 2017
1 parent f83d868 commit 6738c7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/content_sao.cpp
Expand Up @@ -965,7 +965,7 @@ void PlayerSAO::step(float dtime, bool send_recommended)
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 && c.drowning == 0)
if (m_hp > 0 && m_breath < PLAYER_MAX_BREATH && c.drowning == 0)
setBreath(m_breath + 1);
}

Expand Down

0 comments on commit 6738c7e

Please sign in to comment.