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:
kon 2010-11-25 15:52:12 +00:00
parent f850a25529
commit da3b369551

View file

@ -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;