Skip to content

Commit

Permalink
AI: change E_NOT_REACHED_DESTINATION to warning
Browse files Browse the repository at this point in the history
This is not always due to an AI error but can be caused, for example, by a WML event. It should therefore not be an error, but a warning.

This implements feature request #2344.
  • Loading branch information
mattsc committed Dec 31, 2019
1 parent 4fd17e9 commit 16ede10
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions src/ai/actions.cpp
Expand Up @@ -423,7 +423,7 @@ void move_result::do_check_after()
}

if (!unreach_is_ok_ && unit_location_!=to_) {
set_error(E_NOT_REACHED_DESTINATION);
DBG_AI_ACTIONS << "Unit did not reach destination in " << do_describe(); //Demotes to DBG "not reached destination" warning
return;
}
}
Expand Down Expand Up @@ -1086,7 +1086,6 @@ const std::string& actions::get_error_name(int error_code)
error_names_.emplace(move_result::E_INCAPACITATED_UNIT, "move_result::E_INCAPACITATED_UNIT");
error_names_.emplace(move_result::E_AMBUSHED, "move_result::E_AMBUSHED");
error_names_.emplace(move_result::E_FAILED_TELEPORT, "move_result::E_FAILED_TELEPORT");
error_names_.emplace(move_result::E_NOT_REACHED_DESTINATION, "move_result::E_NOT_REACHED_DESTINATION");
error_names_.emplace(move_result::E_NO_ROUTE, "move_result::E_NO_ROUTE");

error_names_.emplace(recall_result::E_NOT_AVAILABLE_FOR_RECALLING, "recall_result::E_NOT_AVAILABLE_FOR_RECALLING");
Expand Down
1 change: 0 additions & 1 deletion src/ai/actions.hpp
Expand Up @@ -174,7 +174,6 @@ class move_result : public action_result {
E_INCAPACITATED_UNIT = 2004,
E_AMBUSHED = 2005,
E_FAILED_TELEPORT = 2006,
E_NOT_REACHED_DESTINATION = 2007,
E_NO_ROUTE = 2008
};

Expand Down

0 comments on commit 16ede10

Please sign in to comment.