Fix cast from const by accessing string data directly (#8354)
[oweals/minetest.git] / src / emerge.h
index 005760150d18240e65233ee6311ac28995c5f839..d4a34451dce3b4930edd40da5405b5a2088549e0 100644 (file)
@@ -21,9 +21,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include <map>
 #include <mutex>
+#include "network/networkprotocol.h"
 #include "irr_v3d.h"
 #include "util/container.h"
-#include "mapgen.h" // for MapgenParams
+#include "mapgen/mapgen.h" // for MapgenParams
 #include "map.h"
 
 #define BLOCK_EMERGE_ALLOW_GEN   (1 << 0)
@@ -35,7 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 }
 
 class EmergeThread;
-class INodeDefManager;
+class NodeDefManager;
 class Settings;
 
 class BiomeManager;
@@ -52,7 +53,7 @@ struct BlockMakeData {
        v3s16 blockpos_max;
        v3s16 blockpos_requested;
        UniqueQueue<v3s16> transforming_liquid;
-       INodeDefManager *nodedef = nullptr;
+       const NodeDefManager *nodedef = nullptr;
 
        BlockMakeData() = default;
 
@@ -87,7 +88,7 @@ struct BlockEmergeData {
 
 class EmergeManager {
 public:
-       INodeDefManager *ndef;
+       const NodeDefManager *ndef;
        bool enable_mapgen_debug_info;
 
        // Generation Notify
@@ -123,14 +124,14 @@ public:
        bool isRunning();
 
        bool enqueueBlockEmerge(
-               u16 peer_id,
+               session_t peer_id,
                v3s16 blockpos,
                bool allow_generate,
                bool ignore_queue_limits=false);
 
        bool enqueueBlockEmergeEx(
                v3s16 blockpos,
-               u16 peer_id,
+               session_t peer_id,
                u16 flags,
                EmergeCompletionCallback callback,
                void *callback_param);