Skip to content

Commit

Permalink
fix aim move query amount showing wrong max amount (#79409)
Browse files Browse the repository at this point in the history
* fix aim query amount showing wrong amount

* Update src/advanced_inv.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
marilynias and github-actions[bot] authored Jan 29, 2025
1 parent d478d52 commit 9baaa00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/advanced_inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,9 @@ bool advanced_inventory::query_charges( aim_location destarea, const advanced_in
// Check volume, this should work the same for inventory, map and vehicles, but not for worn
if( destarea != AIM_WORN && destarea != AIM_WIELD ) {
const units::volume free_volume = panes[dest].free_volume( squares[destarea] );
const int room_for = it.charges_per_volume( free_volume );
const units::mass free_mass = panes[dest].free_weight_capacity();
const int room_for = std::min( it.charges_per_volume( free_volume ),
it.charges_per_weight( free_mass ) );
if( room_for <= 0 ) {
if( destarea == AIM_INVENTORY ) {
popup_getkey( _( "You have no space for the %s." ), it.tname() );
Expand Down

0 comments on commit 9baaa00

Please sign in to comment.