diff --git a/src/advanced_inv.cpp b/src/advanced_inv.cpp index 5d2e37eb302c1..698006d3b7d4d 100644 --- a/src/advanced_inv.cpp +++ b/src/advanced_inv.cpp @@ -703,13 +703,9 @@ void advanced_inventory::redraw_pane( side p ) // draw a darker border around the inactive pane draw_border( w, active ? BORDER_COLOR : c_dark_gray ); mvwprintw( w, point( 3, 0 ), _( "< [s]ort: %s >" ), get_sortname( pane.sortby ) ); - int max = square.max_size; - if( max > 0 ) { - int itemcount = square.get_item_count(); - int fmtw = 7 + ( itemcount > 99 ? 3 : itemcount > 9 ? 2 : 1 ) + - ( max > 99 ? 3 : max > 9 ? 2 : 1 ); - mvwprintw( w, point( w_width / 2 - fmtw, 0 ), "< %d/%d >", itemcount, max ); - } + int itemcount = square.get_item_count(); + int fmtw = 7 + ( itemcount > 99 ? 3 : itemcount > 9 ? 2 : 1 ); + mvwprintw( w, point( w_width / 2 - fmtw, 0 ), "< %d >", itemcount ); const char *fprefix = _( "[F]ilter" ); const char *fsuffix = _( "[R]eset" ); @@ -1509,11 +1505,7 @@ bool advanced_inventory::query_destination( aim_location &def ) } for( auto &ordered_loc : ordered_locs ) { auto &s = squares[ordered_loc]; - const int size = s.get_item_count(); - std::string prefix = string_format( "%2d/%d", size, MAX_ITEM_IN_SQUARE ); - if( size >= MAX_ITEM_IN_SQUARE ) { - prefix += _( " (FULL)" ); - } + std::string prefix = string_format( "%d", s.get_item_count() ); menu.addentry( ordered_loc, s.canputitems() && s.id != panes[src].get_area(), get_location_key( ordered_loc )[0], @@ -1612,27 +1604,6 @@ bool advanced_inventory::query_charges( aim_location destarea, const advanced_in } amount = std::min( room_for, amount ); } - // Map and vehicles have a maximal item count, check that. Inventory does not have this. - if( destarea != AIM_INVENTORY && - destarea != AIM_WORN && - destarea != AIM_CONTAINER ) { - const int cntmax = p.max_size - p.get_item_count(); - // For items counted by charges, adding it adds 0 items if something there stacks with it. - const bool adds0 = by_charges && std::any_of( panes[dest].items.begin(), panes[dest].items.end(), - [&it]( const advanced_inv_listitem & li ) { - return li.is_item_entry() && li.items.front()->stacks_with( it ); - } ); - if( cntmax <= 0 && !adds0 ) { - popup( _( "Destination area has too many items. Remove some first." ) ); - redraw = true; - return false; - } - // Items by charge count as a single item, regardless of the charges. As long as the - // destination can hold another item, one can move all charges. - if( !by_charges ) { - amount = std::min( cntmax, amount ); - } - } // Inventory has a weight capacity, map and vehicle don't have that if( destarea == AIM_INVENTORY || destarea == AIM_WORN ) { const units::mass unitweight = it.weight() / ( by_charges ? it.charges : 1 ); diff --git a/src/advanced_inv_area.cpp b/src/advanced_inv_area.cpp index 7ad84a4c403bf..5e49d00238d24 100644 --- a/src/advanced_inv_area.cpp +++ b/src/advanced_inv_area.cpp @@ -89,7 +89,6 @@ void advanced_inv_area::init() if( vstor >= 0 ) { desc[0] = veh->name; canputitemsloc = true; - max_size = MAX_ITEM_IN_VEHICLE_STORAGE; } else { veh = nullptr; canputitemsloc = false; @@ -128,7 +127,6 @@ void advanced_inv_area::init() vstor = -1; } canputitemsloc = can_store_in_vehicle() || g->m.can_put_items_ter_furn( pos ); - max_size = MAX_ITEM_IN_SQUARE; if( can_store_in_vehicle() ) { desc[1] = vpart_position( *veh, vstor ).get_label().value_or( "" ); } diff --git a/src/advanced_inv_area.h b/src/advanced_inv_area.h index 0a1a1639213fc..82146b7504268 100644 --- a/src/advanced_inv_area.h +++ b/src/advanced_inv_area.h @@ -72,8 +72,6 @@ class advanced_inv_area // total volume and weight of items currently there units::volume volume; units::mass weight; - // maximal count / volume of items there. - int max_size; // appears as part of the legend at the top right const std::string minimapname; // user commant that corresponds to this location @@ -87,7 +85,7 @@ class advanced_inv_area std::string actionname, aim_location relative_location ) : id( id ), hscreen( hscreenx, hscreeny ), off( off ), name( name ), shortname( shortname ), canputitemsloc( false ), veh( nullptr ), vstor( -1 ), volume( 0_ml ), - weight( 0_gram ), max_size( 0 ), minimapname( minimapname ), actionname( actionname ), + weight( 0_gram ), minimapname( minimapname ), actionname( actionname ), relative_location( relative_location ) { } diff --git a/src/game.cpp b/src/game.cpp index 9983f7f5e5078..b94f582e76149 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -8253,7 +8253,7 @@ void game::butcher() // Magic indices for special butcher options enum : int { - MULTISALVAGE = MAX_ITEM_IN_SQUARE + 1, + MULTISALVAGE = std::numeric_limits::max() - 16, MULTIBUTCHER, MULTIDISASSEMBLE_ONE, MULTIDISASSEMBLE_ALL, diff --git a/src/game_constants.h b/src/game_constants.h index b42663e4f4297..0de500ce48170 100644 --- a/src/game_constants.h +++ b/src/game_constants.h @@ -22,10 +22,6 @@ #define BLINK_SPEED 300 #define EXPLOSION_MULTIPLIER 7 -// Really just a sanity check for functions not tested beyond this. in theory 4096 works (`InvletInvlet) -#define MAX_ITEM_IN_SQUARE 4096 -// no reason to differ -#define MAX_ITEM_IN_VEHICLE_STORAGE MAX_ITEM_IN_SQUARE // only can wear a maximum of two of any type of clothing #define MAX_WORN_PER_TYPE 2 diff --git a/src/item_stack.cpp b/src/item_stack.cpp index 910a86fb4fdde..7ce34dae0db83 100644 --- a/src/item_stack.cpp +++ b/src/item_stack.cpp @@ -106,13 +106,6 @@ units::volume item_stack::stored_volume() const int item_stack::amount_can_fit( const item &it ) const { - // Without stacking charges, would we violate the count limit? - const bool violates_count = size() >= static_cast( count_limit() ); - const item *here = it.count_by_charges() ? stacks_with( it ) : nullptr; - - if( violates_count && !here ) { - return 0; - } // Call max because a tile may have been overfilled to begin with (e.g. #14115) const int ret = std::max( 0, it.charges_per_volume( free_volume() ) ); return it.count_by_charges() ? std::min( ret, it.charges ) : ret; diff --git a/src/item_stack.h b/src/item_stack.h index 6df19649b0c6c..dd70b135ac1ce 100644 --- a/src/item_stack.h +++ b/src/item_stack.h @@ -52,8 +52,6 @@ class item_stack const_reverse_iterator rbegin() const; const_reverse_iterator rend() const; - /** Maximum number of items allowed here */ - virtual int count_limit() const = 0; /** Maximum volume allowed here */ virtual units::volume max_volume() const = 0; /** Total volume of the items here */ diff --git a/src/map.cpp b/src/map.cpp index b4b3ec88389fd..b466f7a6c7182 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -4377,7 +4377,7 @@ item &map::add_item_or_charges( const tripoint &pos, item obj, bool overflow ) // Checks if sufficient space at tile to add item auto valid_limits = [&]( const tripoint & e ) { - return obj.volume() <= free_volume( e ) && i_at( e ).size() < MAX_ITEM_IN_SQUARE; + return obj.volume() <= free_volume( e ); }; // Performs the actual insertion of the object onto the map diff --git a/src/map.h b/src/map.h index a8788221e19b6..6b9b2eca4e1f1 100644 --- a/src/map.h +++ b/src/map.h @@ -103,9 +103,6 @@ class map_stack : public item_stack item_stack( newstack ), location( newloc ), myorigin( neworigin ) {} void insert( const item &newitem ) override; iterator erase( const_iterator it ) override; - int count_limit() const override { - return MAX_ITEM_IN_SQUARE; - } units::volume max_volume() const override; }; diff --git a/src/vehicle.h b/src/vehicle.h index 1ffc892abbe00..3e83cc808288a 100644 --- a/src/vehicle.h +++ b/src/vehicle.h @@ -128,9 +128,6 @@ class vehicle_stack : public item_stack item_stack( newstack ), location( newloc ), myorigin( neworigin ), part_num( part ) {} iterator erase( const_iterator it ) override; void insert( const item &newitem ) override; - int count_limit() const override { - return MAX_ITEM_IN_VEHICLE_STORAGE; - } units::volume max_volume() const override; };