Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kade-github committed May 24, 2024
1 parent 918a8d3 commit 505374d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Engine/Audio/AudioManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ class AudioManager {
{
Channel* c = channels[i];

if (!c->isFreed && !c->IsPlaying() && c->lifeTime + c->length < time)
if (c->lifeTime + c->length < time)
{
RemoveChannel(c);
break;
Expand Down
4 changes: 2 additions & 2 deletions src/Game/Objects/Base/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ void Entity::CheckVerticalCollision(glm::vec3& motion)
ray.x = position.x;
ray.z = position.z;

float toX = position.x;
float toZ = position.z;
float toX = (int)position.x + 0.5;
float toZ = (int)position.z + 0.5;

int _lastY = -1;

Expand Down
2 changes: 1 addition & 1 deletion src/Game/Objects/Base/Hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ void Hud::Draw()

// update hand position

glm::vec3 finalPos = ((cam->position + cam->cameraFront * 0.4f) - glm::vec3(0, 0.4, 0)) + (camRight * 0.25f);
glm::vec3 finalPos = ((cam->position + player->front * 0.4f) - glm::vec3(0, 0.4, 0)) + (camRight * 0.25f);

glm::vec3 lerped = glm::vec3(std::lerp(hand->position.x, finalPos.x, 0.2f), std::lerp(hand->position.y, finalPos.y, 0.2f), std::lerp(hand->position.z, finalPos.z, 0.2f));

Expand Down
3 changes: 2 additions & 1 deletion src/Game/Objects/Base/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ void Player::Draw()

bool wasShift = shift;

shift = glfwGetKey(Game::instance->GetWindow(), GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS;
if (isOnGround)
shift = glfwGetKey(Game::instance->GetWindow(), GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS;

if (shiftCancel && shift)
{
Expand Down

0 comments on commit 505374d

Please sign in to comment.