Skip to content

Commit

Permalink
Fix bug: Error typically means error
Browse files Browse the repository at this point in the history
grep'd and didn't find any other places this massively stupid mistake appeared.

rather than change behavior, after correcting the definition, changed the calls.
  • Loading branch information
GregoryLundberg committed Sep 3, 2016
1 parent f7d06f6 commit 0696da4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/team.cpp
Expand Up @@ -39,7 +39,7 @@ static lg::log_domain log_engine("engine");
#define DBG_NG LOG_STREAM(debug, log_engine)
#define LOG_NG LOG_STREAM(info, log_engine)
#define WRN_NG LOG_STREAM(warn, log_engine)
#define ERR_NG LOG_STREAM(warn, log_engine)
#define ERR_NG LOG_STREAM(err, log_engine)

static lg::log_domain log_engine_enemies("engine/enemies");
#define DBG_NGE LOG_STREAM(debug, log_engine_enemies)
Expand Down Expand Up @@ -510,17 +510,18 @@ void team::change_controller_by_wml(const std::string& new_controller_string)
{
CONTROLLER new_controller;
if(!new_controller.parse(new_controller_string)) {
ERR_NG << "ignored attempt to change controller to " << new_controller_string << std::endl;
WRN_NG << "ignored attempt to change controller to " << new_controller_string << std::endl;
return;
}
if(new_controller == CONTROLLER::EMPTY && resources::controller->current_side() == this->side()) {
ERR_NG << "ignored attempt to change the currently playing side's controller to 'null'" << std::endl;
WRN_NG << "ignored attempt to change the currently playing side's controller to 'null'" << std::endl;
return;
}
config choice = synced_context::ask_server_choice(controller_server_choice(new_controller, *this));
if(!new_controller.parse(choice["controller"])) {
//TODO: this should be more than a ERR_NG message.
ERR_NG << "recieved an invalid controller string from the server" << choice["controller"] << std::endl;
// GL-2016SEP02 Oh? So why was ERR_NG defined as warning level? Making the call fit the definition.
WRN_NG << "recieved an invalid controller string from the server" << choice["controller"] << std::endl;
}
if(!resources::controller->is_replay()) {
set_local(choice["is_local"].to_bool());
Expand Down

0 comments on commit 0696da4

Please sign in to comment.