Skip to content

Commit

Permalink
fix: less crashing while auto-driving
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamandus committed May 22, 2024
1 parent 27c4695 commit 3071472
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vehicle_autodrive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static constexpr int TURNING_INCREMENT = 15;
static constexpr int NUM_ORIENTATIONS = 360 / TURNING_INCREMENT;
// min and max speed in tiles/s
static constexpr int MIN_SPEED_TPS = 1;
static constexpr int MAX_SPEED_TPS = 10;
static constexpr int MAX_SPEED_TPS = 11;
static constexpr int VMIPH_PER_TPS = static_cast<int>( vehicles::vmiph_per_tile );

/**
Expand Down Expand Up @@ -853,7 +853,7 @@ scored_address vehicle::autodrive_controller::compute_node_score( const node_add
// TODO: tweak this
constexpr int cost_mult = 1;
constexpr int forward_dist_mult = 10;
constexpr int side_dist_mult = 8;
constexpr int side_dist_mult = 16;
constexpr int angle_mult = 2;
constexpr int nearness_penalty = 15;
scored_address ret{ addr, 0 };
Expand Down Expand Up @@ -887,7 +887,7 @@ void vehicle::autodrive_controller::compute_next_nodes( const node_address &addr
std::vector<std::pair<node_address, navigation_node>> &next_nodes )
const
{
constexpr int move_cost = 10;
constexpr int move_cost = 0;
constexpr int steering_cost = 1;
const int sign = target_speed_tps > 0 ? 1 : -1;
const int target_speed = target_speed_tps * VMIPH_PER_TPS;
Expand Down

0 comments on commit 3071472

Please sign in to comment.