summaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-02-01 16:17:55 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-02-01 16:17:55 +0200
commite92238edc831a34081790e71249f1459e997974c (patch)
tree5406e23bb8fd7895f7ac741ad49085a217b7b758 /src/server.cpp
parent56320f7e8de3cf31cbaf11492528016c4446d8f4 (diff)
downloadminetest-e92238edc831a34081790e71249f1459e997974c.tar.gz
minetest-e92238edc831a34081790e71249f1459e997974c.tar.bz2
minetest-e92238edc831a34081790e71249f1459e997974c.zip
This map generator is starting to look pretty good now... also, disabled loading player position from disk because map is regenerated always.
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 28faaf440..fea4ce734 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -515,9 +515,13 @@ void RemoteClient::GetNextBlocks(Server *server, float dtime,
generate = false;
}
+#if 0
/*
If block is far away, don't generate it unless it is
near ground level
+
+ NOTE: We can't know the ground level this way with the
+ new generator.
*/
if(d > 4)
{
@@ -543,6 +547,7 @@ void RemoteClient::GetNextBlocks(Server *server, float dtime,
generate = false;
}
}
+#endif
/*
Don't draw if not in sight
@@ -610,11 +615,13 @@ void RemoteClient::GetNextBlocks(Server *server, float dtime,
v2s16 p2d(p.X, p.Z);
ServerMap *map = (ServerMap*)(&server->m_env.getMap());
v2s16 chunkpos = map->sector_to_chunk(p2d);
- MapChunk *chunk = map->getChunk(chunkpos);
+ if(map->chunkNonVolatile(chunkpos) == false)
+ block_is_invalid = true;
+ /*MapChunk *chunk = map->getChunk(chunkpos);
if(chunk == NULL)
block_is_invalid = true;
else if(chunk->getIsVolatile() == true)
- block_is_invalid = true;
+ block_is_invalid = true;*/
}
/*
@@ -3175,6 +3182,16 @@ Player *Server::emergePlayer(const char *name, const char *password,
{
setCreativeInventory(player);
}
+
+ /*
+ With new map generator the map is regenerated anyway,
+ so start at somewhere where you probably don't get underground
+ */
+ player->setPosition(intToFloat(v3s16(
+ 0,
+ 50,
+ 0
+ )));
return player;
}
@@ -3206,9 +3223,17 @@ Player *Server::emergePlayer(const char *name, const char *password,
dstream<<"Server: Finding spawn place for player \""
<<player->getName()<<"\""<<std::endl;
-#if 1
v2s16 nodepos;
f32 groundheight = 0;
+#if 1
+ player->setPosition(intToFloat(v3s16(
+ 0,
+ 50,
+ 0
+ )));
+#endif
+#if 0
+#if 0
// Try to find a good place a few times
for(s32 i=0; i<500; i++)
{
@@ -3271,6 +3296,7 @@ Player *Server::emergePlayer(const char *name, const char *password,
groundheight + 15,
nodepos.Y
)));
+#endif
/*
Add player to environment