1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

partly working chunk-based map generator (doesn't save properly, spawn is pretty random)

This commit is contained in:
Perttu Ahola 2011-02-01 03:06:02 +02:00
parent be851871cd
commit 6e196c2ce4
13 changed files with 1370 additions and 126 deletions

View file

@ -606,6 +606,15 @@ void RemoteClient::GetNextBlocks(Server *server, float dtime,
{
block_is_invalid = true;
}
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(chunk == NULL)
block_is_invalid = true;
else if(chunk->getIsVolatile() == true)
block_is_invalid = true;
}
/*
@ -3258,7 +3267,8 @@ Player *Server::emergePlayer(const char *name, const char *password,
player->setPosition(intToFloat(v3s16(
nodepos.X,
groundheight + 1,
//groundheight + 1,
groundheight + 15,
nodepos.Y
)));