forked from 0ad/0ad
Fix #835 more comprehensively (the same bug affects other actions performed on nearby targets while moving)
This was SVN commit r9504.
This commit is contained in:
parent
6b499bdc8a
commit
ba66de2143
@ -175,6 +175,7 @@ var UnitFsmSpec = {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// We are already at the target, or can't move at all
|
// We are already at the target, or can't move at all
|
||||||
|
this.StopMoving();
|
||||||
this.FinishOrder();
|
this.FinishOrder();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -190,6 +191,7 @@ var UnitFsmSpec = {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// We are already at the target, or can't move at all
|
// We are already at the target, or can't move at all
|
||||||
|
this.StopMoving();
|
||||||
this.FinishOrder();
|
this.FinishOrder();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -226,6 +228,7 @@ var UnitFsmSpec = {
|
|||||||
// We are already at the target, or can't move at all,
|
// We are already at the target, or can't move at all,
|
||||||
// so try attacking it from here.
|
// so try attacking it from here.
|
||||||
// TODO: need better handling of the can't-reach-target case
|
// TODO: need better handling of the can't-reach-target case
|
||||||
|
this.StopMoving();
|
||||||
if (this.IsAnimal())
|
if (this.IsAnimal())
|
||||||
this.SetNextState("ANIMAL.COMBAT.ATTACKING");
|
this.SetNextState("ANIMAL.COMBAT.ATTACKING");
|
||||||
else
|
else
|
||||||
@ -261,6 +264,7 @@ var UnitFsmSpec = {
|
|||||||
// We are already at the target, or can't move at all,
|
// We are already at the target, or can't move at all,
|
||||||
// so try gathering it from here.
|
// so try gathering it from here.
|
||||||
// TODO: need better handling of the can't-reach-target case
|
// TODO: need better handling of the can't-reach-target case
|
||||||
|
this.StopMoving();
|
||||||
this.SetNextState("INDIVIDUAL.GATHER.GATHERING");
|
this.SetNextState("INDIVIDUAL.GATHER.GATHERING");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -278,6 +282,7 @@ var UnitFsmSpec = {
|
|||||||
// Maybe we should try to pick another dropsite, to find an
|
// Maybe we should try to pick another dropsite, to find an
|
||||||
// accessible one?
|
// accessible one?
|
||||||
// For now, just give up.
|
// For now, just give up.
|
||||||
|
this.StopMoving();
|
||||||
this.FinishOrder();
|
this.FinishOrder();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -295,6 +300,7 @@ var UnitFsmSpec = {
|
|||||||
// We are already at the target, or can't move at all,
|
// We are already at the target, or can't move at all,
|
||||||
// so try repairing it from here.
|
// so try repairing it from here.
|
||||||
// TODO: need better handling of the can't-reach-target case
|
// TODO: need better handling of the can't-reach-target case
|
||||||
|
this.StopMoving();
|
||||||
this.SetNextState("INDIVIDUAL.REPAIR.REPAIRING");
|
this.SetNextState("INDIVIDUAL.REPAIR.REPAIRING");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -306,6 +312,10 @@ var UnitFsmSpec = {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// TODO: this is probably bogus if the unit was
|
||||||
|
// unable to move at all - we need to do some range checks
|
||||||
|
// before actually garrisoning
|
||||||
|
this.StopMoving();
|
||||||
this.SetNextState("INDIVIDUAL.GARRISON.GARRISONED");
|
this.SetNextState("INDIVIDUAL.GARRISON.GARRISONED");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -671,7 +681,6 @@ var UnitFsmSpec = {
|
|||||||
// off to a different target.)
|
// off to a different target.)
|
||||||
if (this.CheckTargetRange(this.order.data.target, IID_ResourceGatherer))
|
if (this.CheckTargetRange(this.order.data.target, IID_ResourceGatherer))
|
||||||
{
|
{
|
||||||
this.StopMoving();
|
|
||||||
var typename = "gather_" + this.order.data.type.specific;
|
var typename = "gather_" + this.order.data.type.specific;
|
||||||
this.SelectAnimation(typename, false, 1.0, typename);
|
this.SelectAnimation(typename, false, 1.0, typename);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user