]> git.lizzy.rs Git - minetest.git/blobdiff - src/content_sao.cpp
Warnings fix
[minetest.git] / src / content_sao.cpp
index cc02a743146264f939141fe889e12fff628788be..6b3593ec7b134eb7e7bfdfc3dc6ea3ea055e6414 100644 (file)
@@ -68,6 +68,10 @@ class DummyLoadSAO : public ServerActiveObject
                return false;
        }
 
+       bool collideWithObjects() {
+               return false;
+       }
+
 private:
 };
 
@@ -140,6 +144,10 @@ class TestSAO : public ServerActiveObject
                return false;
        }
 
+       bool collideWithObjects() {
+               return false;
+       }
+
 private:
        float m_timer1;
        float m_age;
@@ -325,6 +333,9 @@ class ItemSAO : public ServerActiveObject
                return false;
        }
 
+       bool collideWithObjects() {
+               return false;
+       }
 
 private:
        std::string m_itemstring;
@@ -500,7 +511,8 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
                        v3f p_acceleration = m_acceleration;
                        moveresult = collisionMoveSimple(m_env,m_env->getGameDef(),
                                        pos_max_d, box, stepheight, dtime,
-                                       p_pos, p_velocity, p_acceleration,this);
+                                       p_pos, p_velocity, p_acceleration,
+                                       this, m_prop.collideWithObjects);
                        // Apply results
                        m_base_position = p_pos;
                        m_velocity = p_velocity;
@@ -905,6 +917,10 @@ bool LuaEntitySAO::getCollisionBox(aabb3f *toset) {
        return false;
 }
 
+bool LuaEntitySAO::collideWithObjects(){
+       return m_prop.collideWithObjects;
+}
+
 /*
        PlayerSAO
 */
@@ -935,6 +951,7 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, Player *player_, u16 peer_id_,
        m_moved(false),
        m_inventory_not_sent(false),
        m_hp_not_sent(false),
+       m_breath_not_sent(false),
        m_wielded_item_not_sent(false),
        m_physics_override_speed(1),
        m_physics_override_jump(1),
@@ -1370,6 +1387,16 @@ void PlayerSAO::setHP(s16 hp)
        }
 }
 
+u16 PlayerSAO::getBreath() const
+{
+       return m_player->getBreath();
+}
+
+void PlayerSAO::setBreath(u16 breath)
+{
+       m_player->setBreath(breath);
+}
+
 void PlayerSAO::setArmorGroups(const ItemGroupList &armor_groups)
 {
        m_armor_groups = armor_groups;
@@ -1485,3 +1512,7 @@ bool PlayerSAO::getCollisionBox(aabb3f *toset) {
 
        return true;
 }
+
+bool PlayerSAO::collideWithObjects(){
+       return true;
+}