forked from mirrors/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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user