diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-07-03 15:31:06 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-07-03 15:31:06 +0200 |
commit | c24d988742997af9e4689e0836a6073cdd302c1f (patch) | |
tree | 1327de6e00fb2dcc4156a85896393b1e7c668714 /server.cpp | |
parent | 7add4dd07e17c5a6ba0a2a1d9700d72055b812ae (diff) |
Diffstat (limited to 'server.cpp')
-rw-r--r-- | server.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -106,6 +106,7 @@ void Server::handle_pos(Connection::p c) { m.recv(c->socket); c->pos = m.get_pos(); + TerrainGenerator::p tg = boost::static_pointer_cast<TerrainGenerator>(cache->tl); std::set<std::pair<int64_t, int64_t> > chunks = c->check_chunks(); for(std::set<std::pair<int64_t, int64_t> >::iterator it = chunks.begin(); it != chunks.end(); it++) { // TODO: fix sizes @@ -113,6 +114,12 @@ void Server::handle_pos(Connection::p c) { message::Chunk chunk(it->first, it->second); chunk.set_data(obj->heights); chunk.send(c->socket); + + std::list<Vector3> trees = tg->get_objects(it->first, it->second, 35, 35); + for(std::list<Vector3>::iterator it = trees.begin(); it != trees.end(); it++) { + message::Object tree(0, *it); + tree.send(c->socket); + } } for(std::list<Connection::p>::iterator it = clients.begin(); it != clients.end(); it++) { if(*it == c) |