]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/environment.h
Revert "Fix settings to honor numeric conversion errors"
[dragonfireclient.git] / src / environment.h
index 597ad5ff0187698bdc6c4338f0e3c7e07cea714f..ffd4a15541e61fa91e647558780ace04a9e55261 100644 (file)
@@ -78,7 +78,7 @@ class Environment
        std::list<Player*> getPlayers(bool ignore_disconnected);
        
        u32 getDayNightRatio();
-       
+
        // 0-23999
        virtual void setTimeOfDay(u32 time)
        {
@@ -100,6 +100,12 @@ class Environment
        float getTimeOfDaySpeed()
        { return m_time_of_day_speed; }
 
+       void setDayNightRatioOverride(bool enable, u32 value)
+       {
+               m_enable_day_night_ratio_override = enable;
+               m_day_night_ratio_override = value;
+       }
+
 protected:
        // peer_ids in here should be unique, except that there may be many 0s
        std::list<Player*> m_players;
@@ -110,6 +116,9 @@ class Environment
        float m_time_of_day_speed;
        // Used to buffer dtime for adding to m_time_of_day
        float m_time_counter;
+       // Overriding the day-night ratio is useful for custom sky visuals
+       bool m_enable_day_night_ratio_override;
+       u32 m_day_night_ratio_override;
 };
 
 /*
@@ -170,6 +179,7 @@ class ActiveBlockList
        }
 
        std::set<v3s16> m_list;
+       std::set<v3s16> m_forceloaded_list;
 
 private:
 };
@@ -283,6 +293,7 @@ class ServerEnvironment : public Environment
        // Script-aware node setters
        bool setNode(v3s16 p, const MapNode &n);
        bool removeNode(v3s16 p);
+       bool swapNode(v3s16 p, const MapNode &n);
        
        // Find all active objects inside a radius around a point
        std::set<u16> getObjectsInsideRadius(v3f pos, float radius);
@@ -294,12 +305,18 @@ class ServerEnvironment : public Environment
        void step(f32 dtime);
        
        //check if there's a line of sight between two positions
-       bool line_of_sight(v3f pos1, v3f pos2, float stepsize=1.0);
+       bool line_of_sight(v3f pos1, v3f pos2, float stepsize=1.0, v3s16 *p=NULL);
 
        u32 getGameTime() { return m_game_time; }
 
        void reportMaxLagEstimate(float f) { m_max_lag_estimate = f; }
        float getMaxLagEstimate() { return m_max_lag_estimate; }
+       
+       // is weather active in this environment?
+       bool m_use_weather;
+       
+       std::set<v3s16>* getForceloadedBlocks() { return &m_active_blocks.m_forceloaded_list; };
+       
 private:
 
        /*