Optimize block sent: Fix rendering issue
authorLars Hofhansl <larsh@apache.org>
Thu, 1 Dec 2016 05:42:22 +0000 (21:42 -0800)
committerparamat <mat.gregory@virginmedia.com>
Sat, 3 Dec 2016 02:34:45 +0000 (02:34 +0000)
src/client.cpp
src/clientiface.cpp
src/network/serverpackethandler.cpp

index 5a3dc5df768fa2e6203d57c13d37fa45561e7991..e9d273c695c6ce349fb585ba6ec978516c5512c1 100644 (file)
@@ -951,7 +951,7 @@ void writePlayerPos(LocalPlayer *myplayer, ClientMap *clientMap, NetworkPacket *
                [12+12] s32 pitch*100
                [12+12+4] s32 yaw*100
                [12+12+4+4] u32 keyPressed
-               [12+12+4+4+1] u8 fov*80
+               [12+12+4+4+4] u8 fov*80
                [12+12+4+4+4+1] u8 wanted_range / MAP_BLOCKSIZE
        */
        *pkt << position << speed << pitch << yaw << keyPressed;
@@ -1338,7 +1338,7 @@ void Client::sendPlayerPos()
 
        assert(myplayer->peer_id == our_peer_id);
 
-       NetworkPacket pkt(TOSERVER_PLAYERPOS, 12 + 12 + 4 + 4 + 4);
+       NetworkPacket pkt(TOSERVER_PLAYERPOS, 12 + 12 + 4 + 4 + 4 + 1 + 1);
 
        writePlayerPos(myplayer, &map, &pkt);
 
index abe878ecc328208bdab5c07b29490fce961a8239..0390cf0ffc55e821a9dbf45f5dfe79f8f45ff4a7 100644 (file)
@@ -357,7 +357,7 @@ queue_full_break:
        } else if(nearest_emergefull_d != -1){
                new_nearest_unsent_d = nearest_emergefull_d;
        } else {
-               if(d > g_settings->getS16("max_block_send_distance")){
+               if(d > full_d_max){
                        new_nearest_unsent_d = 0;
                        m_nothing_to_send_pause_timer = 2.0;
                } else {
index 5e50bb865d560fe2273565e5681f8723e99e05c4..dca9aabc48a853fcb3a4327091201970a2879a77 100644 (file)
@@ -794,7 +794,7 @@ void Server::process_PlayerPos(RemotePlayer *player, PlayerSAO *playersao,
        u32 keyPressed = 0;
 
        // default behavior (in case an old client doesn't send these)
-       f32 fov = (72.0*M_PI/180) * 4./3.;
+       f32 fov = 0;
        u8 wanted_range = 0;
 
        if (pkt->getRemainingBytes() >= 4)