]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/content_sao.h
Fix some reference counters (memleak) (#8981)
[dragonfireclient.git] / src / content_sao.h
index beaf697e632f075338ec5bda9b08701f532ba9b7..e9047daf0aa47131c27a4ab2811d0225400c119d 100644 (file)
@@ -122,10 +122,10 @@ class LuaEntitySAO : public UnitSAO
        bool isStaticAllowed() const
        { return m_prop.static_save; }
        void getStaticData(std::string *result) const;
-       int punch(v3f dir,
+       u16 punch(v3f dir,
                const ToolCapabilities *toolcap = nullptr,
                ServerActiveObject *puncher = nullptr,
-               float time_from_last_punch = 1000000);
+               float time_from_last_punch = 1000000.0f);
        void rightClick(ServerActiveObject *clicker);
        void setPos(const v3f &pos);
        void moveTo(v3f pos, bool continuous);
@@ -258,7 +258,7 @@ class PlayerSAO : public UnitSAO
                Interaction interface
        */
 
-       int punch(v3f dir,
+       u16 punch(v3f dir,
                const ToolCapabilities *toolcap,
                ServerActiveObject *puncher,
                float time_from_last_punch);
@@ -277,7 +277,7 @@ class PlayerSAO : public UnitSAO
        void setInventoryModified() {}
        std::string getWieldList() const { return "main"; }
        u16 getWieldIndex() const;
-       ItemStack getWieldedItem() const;
+       ItemStack getWieldedItem(ItemStack *selected, ItemStack *hand = nullptr) const;
        bool setWieldedItem(const ItemStack &item);
 
        /*
@@ -322,6 +322,7 @@ class PlayerSAO : public UnitSAO
        {
                return m_dig_pool;
        }
+       void setMaxSpeedOverride(const v3f &vel);
        // Returns true if cheated
        bool checkMovementCheat();
 
@@ -361,6 +362,8 @@ class PlayerSAO : public UnitSAO
        float m_time_from_last_punch = 0.0f;
        v3s16 m_nocheat_dig_pos = v3s16(32767, 32767, 32767);
        float m_nocheat_dig_time = 0.0f;
+       float m_max_speed_override_time = 0.0f;
+       v3f m_max_speed_override = v3f(0.0f, 0.0f, 0.0f);
 
        // Timers
        IntervalLimiter m_breathing_interval;