Skip to content

Commit

Permalink
Minor bug in load_config returning false.
Browse files Browse the repository at this point in the history
Former-commit-id: 6fa9d28
  • Loading branch information
mihahauke committed May 12, 2016
1 parent 0f6ca25 commit 5e4423c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/ViZDoomGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,8 @@ namespace vizdoom {
if(key == "available_buttons" || key == "availablebuttons"){
std::vector<std::string> str_buttons;
int start_line = line_number;
bool success = DoomGame::ParseListProperty(line_number, val, file, str_buttons );
if(success){
bool parse_success = DoomGame::ParseListProperty(line_number, val, file, str_buttons );
if(parse_success){
unsigned int i = 0;
try{
std::vector<Button> buttons;
Expand All @@ -774,7 +774,7 @@ namespace vizdoom {
}
catch(std::exception){
std::cerr<<"WARNING! Loading config from: \""<<filename<<"\". Unsupported value in lines "<<start_line<<"-"<<line_number<<": "<<str_buttons[i]<<". Lines ignored.\n";

success = false;
}
}
else{
Expand All @@ -788,8 +788,8 @@ namespace vizdoom {
if(key == "available_game_variables" || key == "availablegamevariables"){
std::vector<std::string> str_variables;
int start_line = line_number;
bool success = DoomGame::ParseListProperty(line_number, val, file, str_variables );
if(success){
bool parse_success = DoomGame::ParseListProperty(line_number, val, file, str_variables );
if(parse_success){
unsigned int i = 0;
try{
std::vector<GameVariable> variables;
Expand All @@ -805,7 +805,7 @@ namespace vizdoom {
}
catch(std::exception){
std::cerr<<"WARNING! Loading config from: \""<<filename<<"\". Unsupported value in lines "<<start_line<<"-"<<line_number<<": "<<str_variables[i]<<". Lines ignored.\n";

success = false;
}
}
else{
Expand Down

0 comments on commit 5e4423c

Please sign in to comment.