forked from 0ad/0ad
parent
6fd6295644
commit
a3ca29138e
@ -671,7 +671,7 @@ var UnitFsmSpec = {
|
|||||||
// Check if we are already in range, otherwise walk there
|
// Check if we are already in range, otherwise walk there
|
||||||
if (!this.CheckTargetRangeExplicit(msg.data.target, 0, 10))
|
if (!this.CheckTargetRangeExplicit(msg.data.target, 0, 10))
|
||||||
{
|
{
|
||||||
if (!this.TargetIsAlive(msg.data.target))
|
if (!this.TargetIsAlive(msg.data.target) || !this.CheckTargetVisible(msg.data.target))
|
||||||
// The target was destroyed
|
// The target was destroyed
|
||||||
this.FinishOrder();
|
this.FinishOrder();
|
||||||
else
|
else
|
||||||
@ -690,7 +690,7 @@ var UnitFsmSpec = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
"Order.Gather": function(msg) {
|
"Order.Gather": function(msg) {
|
||||||
if (this.MustKillGatherTarget(msg.data.target))
|
if (this.MustKillGatherTarget(msg.data.target) && this.CheckTargetVisible(msg.data.target))
|
||||||
{
|
{
|
||||||
this.PushOrderFront("Attack", { "target": msg.data.target, "hunting": true });
|
this.PushOrderFront("Attack", { "target": msg.data.target, "hunting": true });
|
||||||
return;
|
return;
|
||||||
@ -744,7 +744,7 @@ var UnitFsmSpec = {
|
|||||||
// Check if we are already in range, otherwise walk there
|
// Check if we are already in range, otherwise walk there
|
||||||
if (!this.CheckTargetRangeExplicit(msg.data.target, 0, 10))
|
if (!this.CheckTargetRangeExplicit(msg.data.target, 0, 10))
|
||||||
{
|
{
|
||||||
if (!this.TargetIsAlive(msg.data.target))
|
if (!this.TargetIsAlive(msg.data.target) || !this.CheckTargetVisible(msg.data.target))
|
||||||
// The target was destroyed
|
// The target was destroyed
|
||||||
this.FinishOrder();
|
this.FinishOrder();
|
||||||
else
|
else
|
||||||
@ -767,7 +767,7 @@ var UnitFsmSpec = {
|
|||||||
// Check if we are already in range, otherwise walk there
|
// Check if we are already in range, otherwise walk there
|
||||||
if (!this.CheckTargetRangeExplicit(msg.data.target, 0, 10))
|
if (!this.CheckTargetRangeExplicit(msg.data.target, 0, 10))
|
||||||
{
|
{
|
||||||
if (!this.TargetIsAlive(msg.data.target))
|
if (!this.TargetIsAlive(msg.data.target) || !this.CheckTargetVisible(msg.data.target))
|
||||||
// The building was finished or destroyed
|
// The building was finished or destroyed
|
||||||
this.FinishOrder();
|
this.FinishOrder();
|
||||||
else
|
else
|
||||||
@ -790,7 +790,7 @@ var UnitFsmSpec = {
|
|||||||
// Check if we are already in range, otherwise walk there
|
// Check if we are already in range, otherwise walk there
|
||||||
if (!this.CheckTargetRangeExplicit(msg.data.target, 0, 10))
|
if (!this.CheckTargetRangeExplicit(msg.data.target, 0, 10))
|
||||||
{
|
{
|
||||||
if (!this.TargetIsAlive(msg.data.target))
|
if (!this.TargetIsAlive(msg.data.target) || !this.CheckTargetVisible(msg.data.target))
|
||||||
// The target was destroyed
|
// The target was destroyed
|
||||||
this.FinishOrder();
|
this.FinishOrder();
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user