Fix repairing/garrisoning range checks following 4fda917f46
4fda917f46
introduced mistakes in range checks which sometimes broke
garrisoning and repairing.
Reported By: gameboy
Differential Revision: https://code.wildfiregames.com/D1963
This was SVN commit r22353.
This commit is contained in:
parent
4a15cc3b9f
commit
6e6f7699d0
@ -2543,7 +2543,7 @@ UnitAI.prototype.UnitFsmSpec = {
|
||||
},
|
||||
|
||||
"MovementUpdate": function() {
|
||||
if (this.CheckRange(this.order.data))
|
||||
if (this.CheckRange(this.order.data, IID_Builder))
|
||||
this.SetNextState("REPAIRING");
|
||||
},
|
||||
},
|
||||
@ -2740,7 +2740,7 @@ UnitAI.prototype.UnitFsmSpec = {
|
||||
|
||||
"APPROACHING": {
|
||||
"enter": function() {
|
||||
if (!this.MoveTo(this.order.data))
|
||||
if (!this.MoveToGarrisonRange(this.order.data.target))
|
||||
{
|
||||
this.FinishOrder();
|
||||
return true;
|
||||
@ -2753,7 +2753,7 @@ UnitAI.prototype.UnitFsmSpec = {
|
||||
},
|
||||
|
||||
"MovementUpdate": function() {
|
||||
if (this.CheckRange(this.order.data))
|
||||
if (this.CheckGarrisonRange(this.order.data.target))
|
||||
this.SetNextState("GARRISONED");
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user