Skip to content

Commit 6f9b30e

Browse files
authored
fix(controls): Make mouse bindings for target selection more intuitive (endless-sky#12519)
* Double-clicking on a non-disabled ship no longer attempts to board the nearest disabled ship if one is present in the system. * Clicking on a ship you have already targeted no longer makes the targeting sound effect if no change has occurred. * Right mouse button no longer targets ships when the "Control ship with mouse" preference is on.
1 parent 0f289da commit 6f9b30e

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

source/Engine.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,16 +2357,25 @@ void Engine::HandleMouseClicks()
23572357
bool clickedAsteroid = false;
23582358
if(clickTarget)
23592359
{
2360-
UI::PlaySound(UI::UISound::TARGET);
23612360
if(mouseButton == secondaryMouseButton)
2361+
{
2362+
UI::PlaySound(UI::UISound::TARGET);
23622363
ai.IssueShipTarget(clickTarget);
2363-
else
2364+
}
2365+
else if(mouseButton == MouseButton::LEFT)
23642366
{
23652367
// Left click: has your flagship select or board the target.
23662368
if(clickTarget == flagship->GetTargetShip())
2367-
activeCommands |= Command::BOARD;
2369+
{
2370+
if(clickTarget->IsDisabled())
2371+
{
2372+
UI::PlaySound(UI::UISound::TARGET);
2373+
activeCommands |= Command::BOARD;
2374+
}
2375+
}
23682376
else
23692377
{
2378+
UI::PlaySound(UI::UISound::TARGET);
23702379
flagship->SetTargetShip(clickTarget);
23712380
if(clickTarget->IsYours())
23722381
player.SelectEscort(clickTarget.get(), hasShift);

0 commit comments

Comments
 (0)