Skip to content

Commit

Permalink
Apply review.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfence committed Dec 29, 2023
1 parent 52e5089 commit d2978dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/network/clientpackethandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ void Client::handleCommand_MovePlayerRel(NetworkPacket *pkt)
*pkt >> added_pos;

LocalPlayer *player = m_env.getLocalPlayer();
assert(player != NULL);
assert(player);
player->addPosition(added_pos);
}

Expand Down
6 changes: 3 additions & 3 deletions src/server/player_sao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,15 @@ void PlayerSAO::setPos(const v3f &pos)

void PlayerSAO::addPos(const v3f &added_pos)
{
if (isAttached())
return;

// Backward compatibility for older clients
if (m_player->protocol_version < 44) {
setPos(getBasePosition() + added_pos);
return;
}

if (isAttached())
return;

// Send mapblock of target location
v3f pos = getBasePosition() + added_pos;
v3s16 blockpos = v3s16(pos.X / MAP_BLOCKSIZE, pos.Y / MAP_BLOCKSIZE, pos.Z / MAP_BLOCKSIZE);
Expand Down

0 comments on commit d2978dc

Please sign in to comment.