From a91668bbf6e7d2f1f2f4cc39c0f002fb26eea090 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Fri, 21 Jul 2023 23:36:51 -0400 Subject: [PATCH] Fix initialization of variables hardcoded, due hp_max/breath_max * related to https://codeberg.org/minenux/minetest-engine-minetest/issues/33 * this is becouse previously code was refactored in commit 76be103a91d6987527af19e87d93007be8ba8a67 --- src/content_sao.cpp | 2 +- src/localplayer.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 424885e62..6cf63c33d 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -779,7 +779,7 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, RemotePlayer *player_, u16 peer_id m_wield_index(0), m_position_not_sent(false), m_is_singleplayer(is_singleplayer), - m_breath(PLAYER_MAX_BREATH), + m_breath(PLAYER_MAX_BREATH_DEFAULT), m_pitch(0), m_fov(0), m_wanted_range(0), diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 05195c91f..a9fcb3053 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -35,7 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc., LocalPlayer::LocalPlayer(Client *client, const char *name): Player(name, client->idef()), parent(NULL), - hp(PLAYER_MAX_HP), + hp(PLAYER_MAX_HP_DEFAULT), isAttached(false), touching_ground(false), in_liquid(false), @@ -76,7 +76,7 @@ LocalPlayer::LocalPlayer(Client *client, const char *name): m_old_node_below(32767,32767,32767), m_old_node_below_type("air"), m_can_jump(false), - m_breath(PLAYER_MAX_BREATH), + m_breath(PLAYER_MAX_BREATH_DEFAULT), m_yaw(0), m_pitch(0), camera_barely_in_ceiling(false),