]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/player.cpp
Areastore: fix "attempt to index a number value"
[dragonfireclient.git] / src / player.cpp
index 0e8fd86d2245c3445ccad7f669cb7aa59acc14ce..3ee34d41f0b594124df8e2dc337878f0a2f17c57 100644 (file)
@@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "player.h"
 
 #include <fstream>
-#include "jthread/jmutexautolock.h"
+#include "threading/mutex_auto_lock.h"
 #include "util/numeric.h"
 #include "hud.h"
 #include "constants.h"
@@ -75,7 +75,8 @@ Player::Player(IGameDef *gamedef, const char *name):
                "listring[]"
                "list[current_player;craftpreview;7,1;1,1;]";
 
-       // Initialize movement settings at default values, so movement can work if the server fails to send them
+       // Initialize movement settings at default values, so movement can work
+       // if the server fails to send them
        movement_acceleration_default   = 3    * BS;
        movement_acceleration_air       = 2    * BS;
        movement_acceleration_fast      = 10   * BS;
@@ -97,9 +98,10 @@ Player::Player(IGameDef *gamedef, const char *name):
        physics_override_sneak        = true;
        physics_override_sneak_glitch = true;
 
-       hud_flags = HUD_FLAG_HOTBAR_VISIBLE | HUD_FLAG_HEALTHBAR_VISIBLE |
-                        HUD_FLAG_CROSSHAIR_VISIBLE | HUD_FLAG_WIELDITEM_VISIBLE |
-                        HUD_FLAG_BREATHBAR_VISIBLE;
+       hud_flags =
+               HUD_FLAG_HOTBAR_VISIBLE    | HUD_FLAG_HEALTHBAR_VISIBLE |
+               HUD_FLAG_CROSSHAIR_VISIBLE | HUD_FLAG_WIELDITEM_VISIBLE |
+               HUD_FLAG_BREATHBAR_VISIBLE | HUD_FLAG_MINIMAP_VISIBLE;
 
        hud_hotbar_itemcount = HUD_HOTBAR_ITEMCOUNT_DEFAULT;
 }
@@ -215,7 +217,7 @@ void Player::deSerialize(std::istream &is, std::string playername)
 
 u32 Player::addHud(HudElement *toadd)
 {
-       JMutexAutoLock lock(m_mutex);
+       MutexAutoLock lock(m_mutex);
 
        u32 id = getFreeHudID();
 
@@ -229,7 +231,7 @@ u32 Player::addHud(HudElement *toadd)
 
 HudElement* Player::getHud(u32 id)
 {
-       JMutexAutoLock lock(m_mutex);
+       MutexAutoLock lock(m_mutex);
 
        if (id < hud.size())
                return hud[id];
@@ -239,7 +241,7 @@ HudElement* Player::getHud(u32 id)
 
 HudElement* Player::removeHud(u32 id)
 {
-       JMutexAutoLock lock(m_mutex);
+       MutexAutoLock lock(m_mutex);
 
        HudElement* retval = NULL;
        if (id < hud.size()) {
@@ -251,7 +253,7 @@ HudElement* Player::removeHud(u32 id)
 
 void Player::clearHud()
 {
-       JMutexAutoLock lock(m_mutex);
+       MutexAutoLock lock(m_mutex);
 
        while(!hud.empty()) {
                delete hud.back();