Skip to content

Commit

Permalink
check emptiness (#36705)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpwbrown authored and kevingranade committed Jan 5, 2020
1 parent 552ecbb commit 921a9f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/activity_item_handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,10 @@ static activity_reason_info can_do_activity_there( const activity_id &act, playe
static std::vector<std::tuple<tripoint, itype_id, int>> requirements_map( player &p,
const int distance = ACTIVITY_SEARCH_DISTANCE )
{
std::vector<std::tuple<tripoint, itype_id, int>> requirement_map;
if( p.backlog.empty() || p.backlog.front().str_values.empty() ) {
return requirement_map;
}
const requirement_data things_to_fetch = requirement_id( p.backlog.front().str_values[0] ).obj();
const activity_id activity_to_restore = p.backlog.front().id();
// NOLINTNEXTLINE(performance-unnecessary-copy-initialization)
Expand All @@ -1601,7 +1605,6 @@ static std::vector<std::tuple<tripoint, itype_id, int>> requirements_map( player
p.backlog.front().id() == activity_id( "ACT_VEHICLE_REPAIR" ) ||
p.backlog.front().id() == activity_id( "ACT_MULTIPLE_FISH" );
// where it is, what it is, how much of it, and how much in total is required of that item.
std::vector<std::tuple<tripoint, itype_id, int>> requirement_map;
std::vector<std::tuple<tripoint, itype_id, int>> final_map;
std::vector<tripoint> loot_spots;
std::vector<tripoint> already_there_spots;
Expand Down

0 comments on commit 921a9f4

Please sign in to comment.