From c156f3d3905edbcee9e41e6f5504308d9178753f Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 7 Feb 2026 18:57:27 -0800 Subject: [PATCH] Prevent jump spamming, disable face-target while mounted, remove auto-attack on right-click target --- src/rendering/camera_controller.cpp | 2 +- src/rendering/renderer.cpp | 2 +- src/ui/game_screen.cpp | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/rendering/camera_controller.cpp b/src/rendering/camera_controller.cpp index bc3bf055..ad745260 100644 --- a/src/rendering/camera_controller.cpp +++ b/src/rendering/camera_controller.cpp @@ -91,7 +91,7 @@ void CameraController::update(float deltaTime) { bool keyE = !uiWantsKeyboard && !sitting && input.isKeyPressed(SDL_SCANCODE_E); bool shiftDown = !uiWantsKeyboard && (input.isKeyPressed(SDL_SCANCODE_LSHIFT) || input.isKeyPressed(SDL_SCANCODE_RSHIFT)); bool ctrlDown = !uiWantsKeyboard && (input.isKeyPressed(SDL_SCANCODE_LCTRL) || input.isKeyPressed(SDL_SCANCODE_RCTRL)); - bool nowJump = !uiWantsKeyboard && !sitting && input.isKeyPressed(SDL_SCANCODE_SPACE); + bool nowJump = !uiWantsKeyboard && !sitting && input.isKeyJustPressed(SDL_SCANCODE_SPACE); // Idle camera: any input resets the timer; timeout triggers a slow orbit pan bool anyInput = leftMouseDown || rightMouseDown || keyW || keyS || keyA || keyD || keyQ || keyE || nowJump; diff --git a/src/rendering/renderer.cpp b/src/rendering/renderer.cpp index b8a142bf..7fdda047 100644 --- a/src/rendering/renderer.cpp +++ b/src/rendering/renderer.cpp @@ -935,7 +935,7 @@ void Renderer::update(float deltaTime) { // Movement-facing comes from camera controller and is decoupled from LMB orbit. if (cameraController->isMoving() || cameraController->isRightMouseHeld()) { characterYaw = cameraController->getFacingYaw(); - } else if (inCombat_ && targetPosition && !emoteActive) { + } else if (inCombat_ && targetPosition && !emoteActive && !isMounted()) { // Face target when in combat and idle glm::vec3 toTarget = *targetPosition - characterPosition; if (glm::length(glm::vec2(toTarget.x, toTarget.y)) > 0.1f) { diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index f4a1fec7..93393518 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -712,11 +712,9 @@ void GameScreen::processTargetInput(game::GameHandler& gameHandler) { if (unit->getHealth() == 0 && unit->getMaxHealth() > 0) { gameHandler.lootTarget(target->getGuid()); } else { - // Interact with friendly NPCs, otherwise attack + // Interact with friendly NPCs; hostile units just get targeted if (!unit->isHostile() && unit->isInteractable()) { gameHandler.interactWithNpc(target->getGuid()); - } else { - gameHandler.startAutoAttack(target->getGuid()); } } } else if (target->getType() == game::ObjectType::PLAYER) {