mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
GatherNearPositiion when the target remains invisible on our second try, instead of going idle.
This improves hunting behaviour, as targets may still be in FOW on the second try, and the unit would go idle - instead it'll now gather near position, which is more likely to find a proper resource. Differential Revision: https://code.wildfiregames.com/D2071 This was SVN commit r22565.
This commit is contained in:
parent
ad4de3d3be
commit
103d89f026
1 changed files with 18 additions and 5 deletions
|
|
@ -527,10 +527,17 @@ UnitAI.prototype.UnitFsmSpec = {
|
|||
this.order.data.secondTry = true;
|
||||
this.PushOrderFront("Walk", this.order.data.lastPos);
|
||||
}
|
||||
// We couldn't move there, or the target moved away
|
||||
else
|
||||
{
|
||||
// We couldn't move there, or the target moved away
|
||||
this.FinishOrder();
|
||||
let data = this.order.data;
|
||||
if (!this.FinishOrder())
|
||||
this.PushOrderFront("GatherNearPosition", {
|
||||
"x": data.lastPos.x,
|
||||
"z": data.lastPos.z,
|
||||
"type": data.type,
|
||||
"template": data.template
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -777,14 +784,20 @@ UnitAI.prototype.UnitFsmSpec = {
|
|||
msg.data.secondTry = true;
|
||||
this.PushOrderFront("Walk", msg.data.lastPos);
|
||||
}
|
||||
// We couldn't move there, or the target moved away
|
||||
else
|
||||
{
|
||||
// We couldn't move there, or the target moved away
|
||||
this.FinishOrder();
|
||||
let data = msg.data;
|
||||
if (!this.FinishOrder())
|
||||
this.PushOrderFront("GatherNearPosition", {
|
||||
"x": data.lastPos.x,
|
||||
"z": data.lastPos.z,
|
||||
"type": data.type,
|
||||
"template": data.template
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
this.PushOrderFront("Attack", { "target": msg.data.target, "force": !!msg.data.force, "hunting": true, "allowCapture": false, "min": 0, "max": 10 });
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue