Skip to content

Commit

Permalink
Merge pull request #72801 from RenechCDDA/recipe_catch_bad_requiremen…
Browse files Browse the repository at this point in the history
…ts_set

Throw error if recipe definition is missing any valid combinations
  • Loading branch information
I-am-Erk authored Apr 4, 2024
2 parents 43b0c4b + db979df commit a1c3934
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/requirements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1647,6 +1647,10 @@ deduped_requirement_data::deduped_requirement_data( const requirement_data &in,
pending.push( { without_dupes, next.index + 1 } );
}

if( alternatives_.empty() && pending.empty() ) {
debugmsg( "Recipe definition %s somehow has no valid recipes!", context.str() );
}

// Because this algorithm is super-exponential in the worst case, add a
// sanity check to prevent things getting too far out of control.
// The worst case in the core game currently is boots_fur
Expand Down

0 comments on commit a1c3934

Please sign in to comment.