Skip to content

Commit 79f3a40

Browse files
committed
2 parents 0f1d5ec + 6fa9d28 commit 79f3a40

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/lib/ViZDoomGame.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,8 @@ namespace vizdoom {
765765
if(key == "available_buttons" || key == "availablebuttons"){
766766
std::vector<std::string> str_buttons;
767767
int start_line = line_number;
768-
bool success = DoomGame::ParseListProperty(line_number, val, file, str_buttons );
769-
if(success){
768+
bool parse_success = DoomGame::ParseListProperty(line_number, val, file, str_buttons );
769+
if(parse_success){
770770
unsigned int i = 0;
771771
try{
772772
std::vector<Button> buttons;
@@ -782,7 +782,7 @@ namespace vizdoom {
782782
}
783783
catch(std::exception){
784784
std::cerr<<"WARNING! Loading config from: \""<<filename<<"\". Unsupported value in lines "<<start_line<<"-"<<line_number<<": "<<str_buttons[i]<<". Lines ignored.\n";
785-
785+
success = false;
786786
}
787787
}
788788
else{
@@ -796,8 +796,8 @@ namespace vizdoom {
796796
if(key == "available_game_variables" || key == "availablegamevariables"){
797797
std::vector<std::string> str_variables;
798798
int start_line = line_number;
799-
bool success = DoomGame::ParseListProperty(line_number, val, file, str_variables );
800-
if(success){
799+
bool parse_success = DoomGame::ParseListProperty(line_number, val, file, str_variables );
800+
if(parse_success){
801801
unsigned int i = 0;
802802
try{
803803
std::vector<GameVariable> variables;
@@ -813,7 +813,7 @@ namespace vizdoom {
813813
}
814814
catch(std::exception){
815815
std::cerr<<"WARNING! Loading config from: \""<<filename<<"\". Unsupported value in lines "<<start_line<<"-"<<line_number<<": "<<str_variables[i]<<". Lines ignored.\n";
816-
816+
success = false;
817817
}
818818
}
819819
else{
@@ -951,8 +951,9 @@ namespace vizdoom {
951951
}
952952
catch( std::exception ){
953953
std::cerr<<"WARNING! Loading config from: \""<<filename<<"\". Boolean value expected insted of: "<<raw_val<<" in line #"<<line_number<<". Line ignored.\n";
954+
success = false;
954955
continue;
955-
success = false;
956+
956957
}
957958

958959
/* Parse enum properties */

0 commit comments

Comments
 (0)