forked from 0ad/0ad
Unify duplicate patrol target types hardcodings. Reviewed by fatherbushido long ago, refs #4253.
This was SVN commit r18983.
This commit is contained in:
parent
c390dee14c
commit
0b03713b3b
@ -210,7 +210,7 @@ function getActionInfo(action, target)
|
||||
else if (Engine.HotkeyIsPressed("session.patrol"))
|
||||
{
|
||||
data.command = "patrol";
|
||||
data.targetClasses = { "attack": ["Unit"] };
|
||||
data.targetClasses = { "attack": g_PatrolTargets };
|
||||
cursor = "action-patrol";
|
||||
}
|
||||
return { "possible": true, "data": data, "cursor": cursor };
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Which enemy entity types will be attacked on sight when patroling.
|
||||
*/
|
||||
var g_PatrolTargets = ["Unit"];
|
||||
|
||||
/**
|
||||
* List of different actions units can execute,
|
||||
* this is mostly used to determine which actions can be executed
|
||||
@ -218,7 +223,7 @@ var unitActions =
|
||||
"x": target.x,
|
||||
"z": target.z,
|
||||
"target": action.target,
|
||||
"targetClasses": { "attack": ["Unit"] }, // patrol should only attack units
|
||||
"targetClasses": { "attack": g_PatrolTargets },
|
||||
"queued": queued,
|
||||
"allowCapture": false
|
||||
});
|
||||
|
@ -1115,7 +1115,7 @@ UnitAI.prototype.UnitFsmSpec = {
|
||||
if (!this.patrolStartPosOrder)
|
||||
{
|
||||
this.patrolStartPosOrder = cmpPosition.GetPosition();
|
||||
this.patrolStartPosOrder.targetClasses = { "attack": ["Unit"] };
|
||||
this.patrolStartPosOrder.targetClasses = this.order.data.targetClasses;
|
||||
}
|
||||
|
||||
this.StartTimer(0, 1000);
|
||||
@ -1645,7 +1645,7 @@ UnitAI.prototype.UnitFsmSpec = {
|
||||
if (!this.patrolStartPosOrder)
|
||||
{
|
||||
this.patrolStartPosOrder = cmpPosition.GetPosition();
|
||||
this.patrolStartPosOrder.targetClasses = { "attack": ["Unit"] };
|
||||
this.patrolStartPosOrder.targetClasses = this.order.data.targetClasses;
|
||||
}
|
||||
|
||||
this.StartTimer(0, 1000);
|
||||
|
Loading…
Reference in New Issue
Block a user