Fixed problem: unit unable to find path to goal if unit is next to goal
Patch by Neil Tan
This commit is contained in:
parent
84d1fe7fcd
commit
780a035f95
1 changed files with 7 additions and 5 deletions
|
@ -559,11 +559,13 @@ static inline int CostMoveTo(unsigned int index, void *data)
|
|||
// moving unit are crossable
|
||||
cost += AStarMovingUnitCrossingCost;
|
||||
} else {
|
||||
// for non moving unit Always Fail
|
||||
// FIXME: Need support for moving a fixed unit to add cost
|
||||
*c = -1;
|
||||
return -1;
|
||||
//cost += AStarFixedUnitCrossingCost;
|
||||
// for non moving unit Always Fail unless goal is unit
|
||||
if((CUnit *) data != goal) {
|
||||
// FIXME: Need support for moving a fixed unit to add cost
|
||||
*c = -1;
|
||||
return -1;
|
||||
//cost += AStarFixedUnitCrossingCost;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add cost of crossing unknown tiles if required
|
||||
|
|
Loading…
Add table
Reference in a new issue