1
0
forked from 0ad/0ad

Adds hotkey for forcing unit attack (useful for destroying enemy farms), based on patch by quonter. Fixes #1489

This was SVN commit r12703.
This commit is contained in:
historic_bruno 2012-09-24 01:14:21 +00:00
parent 60f9fece29
commit 4c37e8de95
2 changed files with 5 additions and 0 deletions

View File

@ -227,6 +227,7 @@ hotkey.selection.group.add.9 = "Shift+9"
; > SESSION CONTROLS
hotkey.session.kill = Delete ; Destroy selected units
hotkey.session.attack = Ctrl ; Modifier to force attack instead of another action
hotkey.session.garrison = Ctrl ; Modifier to garrison when clicking on building
hotkey.session.queue = Shift ; Modifier to queue unit orders instead of replacing
hotkey.session.batchtrain = Shift ; Modifier to train units in batches

View File

@ -465,6 +465,10 @@ function determineAction(x, y, fromMinimap)
break;
}
}
else if (Engine.HotkeyIsPressed("session.attack") && getActionInfo("attack", target).possible)
{
return {"type": "attack", "cursor": "action-attack", "target": target};
}
else if (Engine.HotkeyIsPressed("session.garrison"))
{
if (getActionInfo("garrison", target).possible)