Skip to content

Commit

Permalink
Optimize block sent: Fix rendering issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lhofhansl authored and paramat committed Dec 3, 2016
1 parent e2cbfa8 commit 8a7dc83
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/client.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/clientiface.cpp
Expand Up @@ -357,7 +357,7 @@ void RemoteClient::GetNextBlocks (
} 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 {
Expand Down
2 changes: 1 addition & 1 deletion src/network/serverpackethandler.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit 8a7dc83

Please sign in to comment.