diff --git a/src/playturn.cpp b/src/playturn.cpp index 002def53a71..964507886b5 100644 --- a/src/playturn.cpp +++ b/src/playturn.cpp @@ -274,7 +274,6 @@ void turn_info::mouse_motion(const SDL_MouseMotionEvent& event) gotos.clear(); } - const shortest_path_calculator calc(un->second,current_team, units_,map_); const bool can_teleport = un->second.type().teleports(); @@ -282,8 +281,9 @@ void turn_info::mouse_motion(const SDL_MouseMotionEvent& event) const std::set* const teleports = can_teleport ? ¤t_team.towers() : NULL; - current_route_ = a_star_search(selected_hex_,new_hex, - 10000.0,calc,teleports); + current_route_ = a_star_search( + gotos.empty() ? selected_hex_ : gotos.back(), + new_hex,10000.0,calc,teleports); current_route_.move_left = route_turns_to_complete(un->second,map_,current_route_); @@ -493,7 +493,7 @@ void turn_info::left_click(const SDL_MouseButtonEvent& event) current_route_.steps.front() == selected_hex_) { if(!key_[SDLK_LCTRL] && !key_[SDLK_RCTRL]) { - + units_.find(selected_hex_)->second.set_goto(gamemap::location()); } const size_t moves = move_unit(&gui_,map_,units_,teams_, @@ -757,6 +757,8 @@ void turn_info::undo() if(undo_stack_.empty()) return; + const command_disabler disable_commands; + const int starting_moves = undo_stack_.back().starting_moves; std::vector route = undo_stack_.back().route; std::reverse(route.begin(),route.end()); @@ -799,6 +801,8 @@ void turn_info::redo() if(redo_stack_.empty()) return; + const command_disabler disable_commands; + //clear routes, selected hex, etc gui_.set_paths(NULL); current_paths_ = paths(); @@ -1015,6 +1019,8 @@ void turn_info::recruit() if(browse_) return; + const command_disabler disable_commands; + team& current_team = teams_[team_num_-1]; std::vector sample_units; @@ -1080,6 +1086,8 @@ void turn_info::recall() if(browse_) return; + const command_disabler disable_commands; + team& current_team = teams_[team_num_-1]; //sort the available units into order by value