1
0
forked from 0ad/0ad

Fix 0b41e8ee61, make units again properly hunt animals that died in FoW.

The reason was that the unit immediately tried gathering nearby instead
of going to the unit's last known position.

Related to D1997.

Differential Revision: https://code.wildfiregames.com/D1996
This was SVN commit r22414.
This commit is contained in:
wraitii 2019-06-30 18:55:26 +00:00
parent f42d97c6f3
commit 3e43ddd869

View File

@ -2218,6 +2218,18 @@ UnitAI.prototype.UnitFsmSpec = {
this.SetNextState("APPROACHING");
return;
}
// Our target is no longer visible - go to its last known position first
// and then hopefully it will become visible.
if (!this.CheckTargetVisible(target) && this.order.data.lastPos)
{
this.PushOrderFront("Walk", {
"x": this.order.data.lastPos.x,
"z": this.order.data.lastPos.z,
"force": this.order.data.force
});
return;
}
}
}