Fix typo when setting NavigationRegion travel_cost

(cherry picked from commit 8c324132d0)
This commit is contained in:
Josh Jones 2022-08-07 10:40:33 -07:00 committed by Rémi Verschelde
parent b2ba3bab52
commit 61e28c28cd
2 changed files with 2 additions and 2 deletions

View File

@ -412,7 +412,7 @@ real_t NavigationPolygonInstance::get_enter_cost() const {
void NavigationPolygonInstance::set_travel_cost(real_t p_travel_cost) {
ERR_FAIL_COND_MSG(p_travel_cost < 0.0, "The travel_cost must be positive.");
travel_cost = MAX(p_travel_cost, 0.0);
Navigation2DServer::get_singleton()->region_set_enter_cost(region, travel_cost);
Navigation2DServer::get_singleton()->region_set_travel_cost(region, travel_cost);
}
real_t NavigationPolygonInstance::get_travel_cost() const {

View File

@ -94,7 +94,7 @@ real_t NavigationMeshInstance::get_enter_cost() const {
void NavigationMeshInstance::set_travel_cost(real_t p_travel_cost) {
ERR_FAIL_COND_MSG(p_travel_cost < 0.0, "The travel_cost must be positive.");
travel_cost = MAX(p_travel_cost, 0.0);
NavigationServer::get_singleton()->region_set_enter_cost(region, travel_cost);
NavigationServer::get_singleton()->region_set_travel_cost(region, travel_cost);
}
real_t NavigationMeshInstance::get_travel_cost() const {