Skip to content

Commit

Permalink
when ability not have default value in engine then not check default …
Browse files Browse the repository at this point in the history
…value.

i think have already pull this loop else but i i done error and i repair this forget.
  • Loading branch information
newfrenchy83 committed Nov 15, 2023
1 parent 107ccec commit 8f27bba
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/units/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,12 @@ static bool matches_ability_filter(const config & cfg, const std::string& tag_na
return false;

if(!filter["value"].empty()){
if(!has_value_changing_modifier(cfg)){
if(has_value_changing_modifier(cfg)){
//if true, then default value modified, and can't be checked.
if(!int_matches_if_present(filter, cfg, "value")){
return false;
}
} else {
if(tag_name == "drains"){
if(!int_matches_if_present(filter, cfg, "value", 50)){
return false;
Expand All @@ -1506,10 +1511,11 @@ static bool matches_ability_filter(const config & cfg, const std::string& tag_na
if(!int_matches_if_present(filter, cfg, "value" , 0)){
return false;
}
}
} else {
if(!int_matches_if_present(filter, cfg, "value")){
return false;
//if other tags, then ability can't have default value
} else {
if(!int_matches_if_present(filter, cfg, "value")){
return false;
}
}
}
}
Expand Down

0 comments on commit 8f27bba

Please sign in to comment.