forked from 0ad/0ad
Right-clicking with buildings selected should always set the rally point, even when clicking on another unit
This was SVN commit r7866.
This commit is contained in:
parent
0adb57ef98
commit
eef74bb784
@ -90,17 +90,9 @@ function determineAction(x, y)
|
|||||||
|
|
||||||
var targets = Engine.PickEntitiesAtPoint(x, y);
|
var targets = Engine.PickEntitiesAtPoint(x, y);
|
||||||
|
|
||||||
// If there's no target unit
|
// If there's a target unit
|
||||||
if (!targets.length)
|
if (targets.length)
|
||||||
{
|
{
|
||||||
// If all selected entities are buildings,
|
|
||||||
// set rally points, else make them walk
|
|
||||||
if (haveRallyPoints)
|
|
||||||
return {"type": "set-rallypoint"};
|
|
||||||
else
|
|
||||||
return {"type": "move"};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Look at the first targeted entity
|
// Look at the first targeted entity
|
||||||
// (TODO: maybe we eventually want to look at more, and be more context-sensitive?
|
// (TODO: maybe we eventually want to look at more, and be more context-sensitive?
|
||||||
// e.g. prefer to attack an enemy unit, even if some friendly units are closer to the mouse)
|
// e.g. prefer to attack an enemy unit, even if some friendly units are closer to the mouse)
|
||||||
@ -141,8 +133,13 @@ function determineAction(x, y)
|
|||||||
return {"type": "attack", "cursor": "action-attack", "target": targets[0]};
|
return {"type": "attack", "cursor": "action-attack", "target": targets[0]};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If we don't do anything more specific, just walk
|
// If we don't do anything more specific:
|
||||||
|
// If all selected entities are buildings, set rally points, else walk
|
||||||
|
if (haveRallyPoints)
|
||||||
|
return {"type": "set-rallypoint"};
|
||||||
|
else
|
||||||
return {"type": "move"};
|
return {"type": "move"};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user