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:
Ykkrosh 2010-08-07 21:27:09 +00:00
parent 0adb57ef98
commit eef74bb784

View File

@ -90,17 +90,9 @@ function determineAction(x, y)
var targets = Engine.PickEntitiesAtPoint(x, y);
// If there's no target unit
if (!targets.length)
// If there's a target unit
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
// (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)
@ -141,8 +133,13 @@ function determineAction(x, y)
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"};
}