Skip to content

Commit

Permalink
Make exertion levels mandatory
Browse files Browse the repository at this point in the history
Prevent potential unintended behavior and remove the hacks necessary
for automation - make all recipes specify an activity level.
  • Loading branch information
anothersimulacrum committed Aug 19, 2020
1 parent 9c6d9b7 commit c35e493
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/recipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,7 @@ void recipe::load( const JsonObject &jo, const std::string &src )
}

// Mandatory: This recipe's exertion level
// TODO: Make this mandatory, no default or 'fake' exception
std::string exert = jo.get_string( "activity_level", "MODERATE_EXERCISE" );
// For making scripting that needs to be broken up over multiple PRs easier
if( exert == "fake" ) {
exert = "MODERATE_EXERCISE";
}
std::string exert = jo.get_string( "activity_level" );
const auto it = activity_levels.find( exert );
if( it == activity_levels.end() ) {
jo.throw_error( string_format( "Invalid activity level %s", exert ), "activity_level" );
Expand Down

0 comments on commit c35e493

Please sign in to comment.