Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -rupN minetest_orig/src/server.cpp minetest_modified/src/server.cpp
- --- minetest_orig/src/server.cpp 2011-11-12 17:17:42.000000000 +0100
- +++ minetest_modified/src/server.cpp 2011-11-24 15:53:37.762770923 +0100
- @@ -2671,6 +2671,43 @@ void Server::ProcessData(u8 *data, u32 d
- client->SetBlockNotSent(blockpos);
- return;
- }
- +
- + if ((g_settings->getBool("free_move") == false) &&
- + (content_features(((MaterialItem*)item)->getMaterial()).air_equivalent == false))
- + {
- + float distance;
- + core::list<Player*> players = m_env.getPlayers();
- + core::list<Player*>::Iterator ip;
- +
- + for(ip = players.begin(); ip != players.end(); ip++) {
- + Player *p = *ip;
- + v3f player_pos = p->getPosition();
- + v3f player_eye_pos = p->getEyePosition();
- +
- + // this is strange. I would expect that (p->touching_ground == false) prevents a block
- + // to be placed at the current players "legs" but it doesn't. Seems that standing on
- + // something doesn't mean to touch ground? Not a big problem here IMHO.
- + if((p == player) && (p->touching_ground == false)) {
- + distance = BS*0.4;
- + } else {
- + distance = BS*0.9;
- + }
- +
- + if((player_pos.getDistanceFrom(intToFloat(p_over, BS)) <= distance) ||
- + (player_eye_pos.getDistanceFrom(intToFloat(p_over, BS)) <= distance))
- + {
- + infostream << "Client "<<peer_id<<" tried to place"
- + << " block on a player position;"
- + << " setting MapBlock not sent."<<std::endl;
- +
- + RemoteClient *client = getClient(peer_id);
- + v3s16 blockpos = getNodeBlockPos(p_over);
- + client->SetBlockNotSent(blockpos);
- + return;
- + }
- + }
- + }
- +
- }
- catch(InvalidPositionException &e)
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement