Skip to content

Commit 5e4423c

Browse files
committed
Minor bug in load_config returning false.
Former-commit-id: 6fa9d28
1 parent 0f6ca25 commit 5e4423c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib/ViZDoomGame.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,8 @@ namespace vizdoom {
757757
if(key == "available_buttons" || key == "availablebuttons"){
758758
std::vector<std::string> str_buttons;
759759
int start_line = line_number;
760-
bool success = DoomGame::ParseListProperty(line_number, val, file, str_buttons );
761-
if(success){
760+
bool parse_success = DoomGame::ParseListProperty(line_number, val, file, str_buttons );
761+
if(parse_success){
762762
unsigned int i = 0;
763763
try{
764764
std::vector<Button> buttons;
@@ -774,7 +774,7 @@ namespace vizdoom {
774774
}
775775
catch(std::exception){
776776
std::cerr<<"WARNING! Loading config from: \""<<filename<<"\". Unsupported value in lines "<<start_line<<"-"<<line_number<<": "<<str_buttons[i]<<". Lines ignored.\n";
777-
777+
success = false;
778778
}
779779
}
780780
else{
@@ -788,8 +788,8 @@ namespace vizdoom {
788788
if(key == "available_game_variables" || key == "availablegamevariables"){
789789
std::vector<std::string> str_variables;
790790
int start_line = line_number;
791-
bool success = DoomGame::ParseListProperty(line_number, val, file, str_variables );
792-
if(success){
791+
bool parse_success = DoomGame::ParseListProperty(line_number, val, file, str_variables );
792+
if(parse_success){
793793
unsigned int i = 0;
794794
try{
795795
std::vector<GameVariable> variables;
@@ -805,7 +805,7 @@ namespace vizdoom {
805805
}
806806
catch(std::exception){
807807
std::cerr<<"WARNING! Loading config from: \""<<filename<<"\". Unsupported value in lines "<<start_line<<"-"<<line_number<<": "<<str_variables[i]<<". Lines ignored.\n";
808-
808+
success = false;
809809
}
810810
}
811811
else{

0 commit comments

Comments
 (0)