1
1
forked from 0ad/0ad

Make sure hunting units don't forget about the initial herd position (fix for 8a38cfb7cf)

Units move the InitPos of the heard to the last known position when
going through Order.Gather, which they do multiple times when hunting,
thus making them mistakenly move the herd position and unable to find it
back.

Differential Revision: https://code.wildfiregames.com/D2073
This was SVN commit r22471.
This commit is contained in:
wraitii 2019-07-14 09:38:17 +00:00
parent 69f7a48dd9
commit e53fb0a8d7

View File

@ -529,7 +529,8 @@ UnitAI.prototype.UnitFsmSpec = {
}
this.RememberTargetPosition();
this.order.data.initPos = this.order.data.lastPos;
if (!this.order.data.initPos)
this.order.data.initPos = this.order.data.lastPos;
if (this.CheckTargetRange(this.order.data.target, IID_ResourceGatherer))
this.SetNextState("INDIVIDUAL.GATHER.GATHERING");