]> git.lizzy.rs Git - minetest.git/blobdiff - src/content_sao.h
Use player:set_hotbar_image() instead of hardcoded hotbar.png
[minetest.git] / src / content_sao.h
index 413fd3e683331864103164533b61eeefa1585ff7..6b97cb1488ddd6ad92688af7d9cd3a672ea0c490 100644 (file)
@@ -124,30 +124,30 @@ class LuaEntitySAO : public ServerActiveObject
 
 class LagPool
 {
-       float pool;
-       float max;
+       float m_pool;
+       float m_max;
 public:
-       LagPool(): pool(15), max(15)
+       LagPool(): m_pool(15), m_max(15)
        {}
        void setMax(float new_max)
        {
-               max = new_max;
-               if(pool > new_max)
-                       pool = new_max;
+               m_max = new_max;
+               if(m_pool > new_max)
+                       m_pool = new_max;
        }
        void add(float dtime)
        {
-               pool -= dtime;
-               if(pool < 0)
-                       pool = 0;
+               m_pool -= dtime;
+               if(m_pool < 0)
+                       m_pool = 0;
        }
        bool grab(float dtime)
        {
                if(dtime <= 0)
                        return true;
-               if(pool + dtime > max)
+               if(m_pool + dtime > m_max)
                        return false;
-               pool += dtime;
+               m_pool += dtime;
                return true;
        }
 };
@@ -193,6 +193,7 @@ class PlayerSAO : public ServerActiveObject
        void rightClick(ServerActiveObject *clicker);
        s16 getHP() const;
        void setHP(s16 hp);
+       s16 readDamage();
        u16 getBreath() const;
        void setBreath(u16 breath);
        void setArmorGroups(const ItemGroupList &armor_groups);
@@ -283,6 +284,7 @@ class PlayerSAO : public ServerActiveObject
        Player *m_player;
        u16 m_peer_id;
        Inventory *m_inventory;
+       s16 m_damage;
 
        // Cheat prevention
        LagPool m_dig_pool;