Skip to content

Commit

Permalink
replace impossible check with assert.
Browse files Browse the repository at this point in the history
since we refactored gamestate construction to initialize units last, it is no longer possible that resources::filter_con is a nullptr here.
  • Loading branch information
gfgtdf committed Oct 27, 2018
1 parent 783dc07 commit cc5aac7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/units/unit.cpp
Expand Up @@ -2169,8 +2169,8 @@ void unit::add_modification(const std::string& mod_type, const config& mod, bool
for(const config& effect : mod.child_range("effect")) {
// Apply SUF.
if(const config& afilter = effect.child("filter")) {
// @FIXME: during gamestate construction resources::filter_con is not available
if(resources::filter_con && !unit_filter(vconfig(afilter)).matches(*this, loc_)) {
assert(resources::filter_con);
if(!unit_filter(vconfig(afilter)).matches(*this, loc_)) {
continue;
}
}
Expand Down

0 comments on commit cc5aac7

Please sign in to comment.