From 90d793f8f369bf1431d7a915198cd49b98bbe2d7 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 23 Jul 2011 16:55:26 +0300 Subject: extended content-type range --- src/server.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/server.cpp') diff --git a/src/server.cpp b/src/server.cpp index c2433e1af..e3c6ce4d9 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2494,7 +2494,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) // Mandatory parameter; actually used for nothing core::map modified_blocks; - u8 material = CONTENT_IGNORE; + content_t material = CONTENT_IGNORE; u8 mineral = MINERAL_NONE; bool cannot_remove_node = false; @@ -2505,7 +2505,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) // Get mineral mineral = n.getMineral(); // Get material at position - material = n.d; + material = n.getContent(); // If not yet cancelled if(cannot_remove_node == false) { @@ -2705,7 +2705,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) <<" because privileges are "<getMaterial(); + n.setContent(mitem->getMaterial()); // Calculate direction for wall mounted stuff - if(content_features(n.d).wall_mounted) - n.dir = packDir(p_under - p_over); + if(content_features(n).wall_mounted) + n.param2 = packDir(p_under - p_over); // Calculate the direction for furnaces and chests and stuff - if(content_features(n.d).param_type == CPT_FACEDIR_SIMPLE) + if(content_features(n).param_type == CPT_FACEDIR_SIMPLE) { v3f playerpos = player->getPosition(); v3f blockpos = intToFloat(p_over, BS) - playerpos; -- cgit v1.2.3 From 29d905f98a8ce7db9ae78a572b51d479f04fb48d Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 24 Jul 2011 12:09:33 +0300 Subject: Added a mapblock analyzing function for debugging use and fixed remaining mapgen bugs --- src/server.cpp | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) (limited to 'src/server.cpp') diff --git a/src/server.cpp b/src/server.cpp index e3c6ce4d9..e2e6ce46b 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -105,10 +105,10 @@ void * EmergeThread::Thread() DSTACK(__FUNCTION_NAME); - //bool debug=false; - BEGIN_DEBUG_EXCEPTION_HANDLER + bool enable_mapgen_debug_info = g_settings.getBool("enable_mapgen_debug_info"); + /* Get block info from queue, emerge them and send them to clients. @@ -155,7 +155,7 @@ void * EmergeThread::Thread() Also decrement the emerge queue count in clients. */ - bool optional = true; + bool only_from_disk = true; { core::map::Iterator i; @@ -166,14 +166,15 @@ void * EmergeThread::Thread() // Check flags u8 flags = i.getNode()->getValue(); if((flags & BLOCK_EMERGE_FLAG_FROMDISK) == false) - optional = false; + only_from_disk = false; } } - - /*dstream<<"EmergeThread: p=" - <<"("<isGenerated() == false) + { + if(enable_mapgen_debug_info) + dstream<<"EmergeThread: generating"<