Let Lua update AStar*UnitCrossingCost
SetAStarFixedUnitCrossingCost and SetAStarMovingUnitCrossingCost only validated the new costs. Make them set the corresponding variables too. CostMoveTo in pathfinder.cpp still doesn't actually use AStarFixedUnitCrossingCost. There is a FIXME comment about that. I don't know why these costs must be greater than three. AStarFindPath increments them by one for each step anyway.
This commit is contained in:
parent
f850a25529
commit
da3b369551
1 changed files with 4 additions and 0 deletions
|
@ -1071,7 +1071,9 @@ void AStarFreeStats(StatsNode *stats)
|
|||
void SetAStarFixedUnitCrossingCost(int cost) {
|
||||
if (cost <= 3) {
|
||||
fprintf(stderr, "AStarFixedUnitCrossingCost must be greater than 3\n");
|
||||
return;
|
||||
}
|
||||
AStarFixedUnitCrossingCost = cost;
|
||||
}
|
||||
int GetAStarFixedUnitCrossingCost() {
|
||||
return AStarFixedUnitCrossingCost;
|
||||
|
@ -1081,7 +1083,9 @@ int GetAStarFixedUnitCrossingCost() {
|
|||
void SetAStarMovingUnitCrossingCost(int cost) {
|
||||
if (cost <= 3) {
|
||||
fprintf(stderr, "AStarMovingUnitCrossingCost must be greater than 3\n");
|
||||
return;
|
||||
}
|
||||
AStarMovingUnitCrossingCost = cost;
|
||||
}
|
||||
int GetAStarMovingUnitCrossingCost() {
|
||||
return AStarMovingUnitCrossingCost;
|
||||
|
|
Loading…
Add table
Reference in a new issue