Skip to content

Commit

Permalink
Change player position to be at the feet, rather than the head
Browse files Browse the repository at this point in the history
Note: This breaks the visualization of the other players (PlayerBox).
  • Loading branch information
Pedro Gimeno committed Feb 26, 2020
1 parent 101df11 commit 89a1520
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/source/world/ClientPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ClientPlayer::ClientPlayer(gk::Camera &camera) : m_camera(camera) {
// FIXME: Warning: Duplicated in ServerCommandHandler.hpp
m_x = 14;
m_y = 14;
m_z = 20;
m_z = 18;

m_viewAngleH = -90.;
m_viewAngleV = 0.01;
Expand Down Expand Up @@ -118,7 +118,7 @@ void ClientPlayer::processInputs() {
}

void ClientPlayer::updatePosition(const ClientWorld &world) {
ClientChunk *chunk = (ClientChunk *)world.getChunkAtBlockPos(m_x, m_y, m_z - 0.2);
ClientChunk *chunk = (ClientChunk *)world.getChunkAtBlockPos(m_x, m_y, m_z);
if (!Config::isFlyModeEnabled && chunk && chunk->isInitialized()) {
m_velocity.z -= m_gravity; // Gravity

Expand Down
2 changes: 1 addition & 1 deletion common/source/world/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "Player.hpp"

Player::Player() {
m_hitbox = gk::FloatBox{-0.2, -0.2, -1.8, 0.4, 0.4, 1.8};
m_hitbox = gk::FloatBox{-0.3125, -0.3125, 0, 0.625, 0.625, 1.75};
}

void Player::serialize(sf::Packet &packet) const {
Expand Down
2 changes: 1 addition & 1 deletion server/include/network/ServerCommandHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ServerCommandHandler {
Registry &m_registry;

// FIXME: Warning: Duplicated in ClientPlayer.cpp
gk::Vector3<s32> m_spawnPosition{14, 14, 20};
gk::Vector3<s32> m_spawnPosition{14, 14, 18};
};

#endif // SERVERCOMMANDHANDLER_HPP_

0 comments on commit 89a1520

Please sign in to comment.