Skip to content

Commit

Permalink
Fixed clamping order count in trading inventory
Browse files Browse the repository at this point in the history
Argument order and types were all wrong.

Found due to -D_GLIBCXX_ASSERTIONS, consider enabling it for
experimental builds maybe?

fixes #75742
  • Loading branch information
l29ah committed Aug 20, 2024
1 parent de745ea commit 235d238
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/inventory_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3943,8 +3943,8 @@ void inventory_multiselector::on_input( const inventory_input &input )
if( entry.is_selectable() ) {
size_t const count = entry.chosen_count;
size_t const max = entry.get_available_count();
size_t const newcount = std::clamp<size_t>( 0,
count + ( input.action == "INCREASE_COUNT" ? +1 : -1 ),
size_t const newcount = std::clamp<ssize_t>( count + ( input.action == "INCREASE_COUNT" ? +1 : -1 ),
0,
max );
toggle_entry( entry, newcount );
}
Expand Down

0 comments on commit 235d238

Please sign in to comment.