mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Prevent jump spamming, disable face-target while mounted, remove auto-attack on right-click target
This commit is contained in:
parent
2fb01abcaa
commit
c156f3d390
3 changed files with 3 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue