Prevent jump spamming, disable face-target while mounted, remove auto-attack on right-click target

This commit is contained in:
Kelsi 2026-02-07 18:57:27 -08:00
parent 2fb01abcaa
commit c156f3d390
3 changed files with 3 additions and 5 deletions

View file

@ -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;

View file

@ -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) {

View file

@ -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) {