Skip to content

Commit

Permalink
class definitions for item_pocket and item_contents
Browse files Browse the repository at this point in the history
  • Loading branch information
KorGgenT committed Jan 4, 2020
1 parent 07dc4f5 commit e47a2a1
Show file tree
Hide file tree
Showing 9 changed files with 1,303 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/crafting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ class basecamp;

static const efftype_id effect_contacts( "contacts" );

void drop_or_handle( const item &newit, player &p );

static const trait_id trait_DEBUG_HS( "DEBUG_HS" );
static const trait_id trait_BURROW( "BURROW" );

Expand Down Expand Up @@ -2247,7 +2245,7 @@ void remove_ammo( std::list<item> &dis_items, player &p )
}
}

void drop_or_handle( const item &newit, player &p )
void drop_or_handle( const item &newit, Character &p )
{
if( newit.made_of( LIQUID ) && p.is_player() ) { // TODO: what about NPCs?
liquid_handler::handle_all_liquid( newit, PICKUP_RANGE );
Expand Down
3 changes: 3 additions & 0 deletions src/crafting.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <list>

class Character;
class item;
class player;
class recipe;
Expand All @@ -16,4 +17,6 @@ void remove_ammo( std::list<item> &dis_items, player &p );

const recipe *select_crafting_recipe( int &batch_size );

void drop_or_handle( const item &newit, Character &p );

#endif
5 changes: 5 additions & 0 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8984,6 +8984,11 @@ bool item::process_blackpowder_fouling( player *carrier )
return false;
}

void item::set_last_rot_check( const time_point &pt )
{
last_rot_check = pt;
}

bool item::process( player *carrier, const tripoint &pos, bool activate,
float insulation, const temperature_flag flag )
{
Expand Down
2 changes: 2 additions & 0 deletions src/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,8 @@ class item : public visitable<item>
item *get_food();
const item *get_food() const;

void set_last_rot_check( const time_point &pt );

/** What faults can potentially occur with this item? */
std::set<fault_id> faults_potential() const;

Expand Down
Loading

0 comments on commit e47a2a1

Please sign in to comment.