Skip to content

Commit

Permalink
Fix C formating. Remove added method, which is not necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfence committed Dec 28, 2023
1 parent ca60345 commit 0ad05b0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3420,10 +3420,6 @@ Address Server::getPeerAddress(session_t peer_id)
// Note that this is only set after Init was received in Server::handleCommand_Init
return getClient(peer_id, CS_Invalid)->getAddress();
}
u16 Server::getPeerProtocolVersion(session_t peer_id)
{
return m_clients.getProtocolVersion(peer_id);
}

void Server::setLocalPlayerAnimations(RemotePlayer *player,
v2s32 animation_frames[4], f32 frame_speed)
Expand Down
1 change: 0 additions & 1 deletion src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ class Server : public con::PeerHandler, public MapEventReceiver,
void hudSetHotbarSelectedImage(RemotePlayer *player, const std::string &name);

Address getPeerAddress(session_t peer_id);
u16 getPeerProtocolVersion(session_t peer_id);

void setLocalPlayerAnimations(RemotePlayer *player, v2s32 animation_frames[4],
f32 frame_speed);
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 @@ -370,16 +370,16 @@ void PlayerSAO::setPos(const v3f &pos)
void PlayerSAO::addPos(const v3f &added_pos)
{
// Backward compatibility for older clients
if (m_env->getGameDef()->getPeerProtocolVersion(m_peer_id) < 44) {
setPos(getBasePosition()+added_pos);
if (m_player->protocol_version < 44) {
setPos(getBasePosition() + added_pos);
return;
}

if(isAttached())
return;

// Send mapblock of target location
v3f pos = getBasePosition()+added_pos;
v3f pos = getBasePosition() + added_pos;
v3s16 blockpos = v3s16(pos.X / MAP_BLOCKSIZE, pos.Y / MAP_BLOCKSIZE, pos.Z / MAP_BLOCKSIZE);
m_env->getGameDef()->SendBlock(m_peer_id, blockpos);

Expand Down

0 comments on commit 0ad05b0

Please sign in to comment.