diff --git a/src/objects/Player.cpp b/src/objects/Player.cpp index 76fd6c9d..223c1828 100644 --- a/src/objects/Player.cpp +++ b/src/objects/Player.cpp @@ -16,13 +16,14 @@ #include "world/Level.hpp" #include "data/dv_util.hpp" -const float CROUCH_SPEED_MUL = 0.35f; -const float RUN_SPEED_MUL = 1.5f; -const float PLAYER_GROUND_DAMPING = 10.0f; -const float PLAYER_AIR_DAMPING = 7.0f; -const float FLIGHT_SPEED_MUL = 4.0f; -const float CHEAT_SPEED_MUL = 5.0f; -const float JUMP_FORCE = 8.0f; +constexpr float CROUCH_SPEED_MUL = 0.35f; +constexpr float RUN_SPEED_MUL = 1.5f; +constexpr float PLAYER_GROUND_DAMPING = 10.0f; +constexpr float PLAYER_AIR_DAMPING = 7.0f; +constexpr float FLIGHT_SPEED_MUL = 4.0f; +constexpr float CHEAT_SPEED_MUL = 5.0f; +constexpr float JUMP_FORCE = 8.0f; +constexpr int SPAWN_ATTEMPTS_PER_UPDATE = 64; Player::Player( Level* level, @@ -156,7 +157,9 @@ void Player::postUpdate() { flight = false; } if (spawnpoint.y <= 0.1) { - attemptToFindSpawnpoint(); + for (int i = 0; i < SPAWN_ATTEMPTS_PER_UPDATE; i++) { + attemptToFindSpawnpoint(); + } } auto& skeleton = entity->getSkeleton(); diff --git a/src/world/generator/VoxelFragment.cpp b/src/world/generator/VoxelFragment.cpp index 96191725..70dda238 100644 --- a/src/world/generator/VoxelFragment.cpp +++ b/src/world/generator/VoxelFragment.cpp @@ -183,7 +183,7 @@ std::unique_ptr VoxelFragment::rotated(const Content& content) co if (def.rotations.name == BlockRotProfile::PANE_NAME || def.rotations.name == BlockRotProfile::PIPE_NAME){ if (voxel.state.rotation < 4) { - voxel.state.rotation = (voxel.state.rotation + 1) & 0b11; + voxel.state.rotation = (voxel.state.rotation + 3) & 0b11; } } }