From e944545b49234a41befee2885120bae10635fb73 Mon Sep 17 00:00:00 2001 From: Emil Milanov Date: Wed, 19 May 2021 23:42:20 +0200 Subject: [PATCH] Fix an edge cases where the full charge is traded, but the UI shows just partial charge. --- src/npctrade.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/npctrade.cpp b/src/npctrade.cpp index 466da021e7948..09554953efb7a 100644 --- a/src/npctrade.cpp +++ b/src/npctrade.cpp @@ -727,10 +727,14 @@ bool trading_window::perform_trade( npc &np, const std::string &deal ) // and then select the entire container. // The state that the container is deselected, but some ( not all! ) of it's contents remain selected shouldn't happen else if( ip.selected && content->selected ) { + // deselect current charge / count content->selected = false; + content->marked = false; int change_amount = get_change_amount( *content, false ); - adjust_balance( *content, np, change_amount * -1 ); - + adjust_balance( *content, np, change_amount ); + // select full charge coutn + content->marked = true; + get_change_amount( *content, false ); } } }