Skip to content

Commit

Permalink
Fix an edge cases where the full charge is traded, but the UI shows j…
Browse files Browse the repository at this point in the history
…ust partial charge.
  • Loading branch information
emomicrowave committed May 19, 2021
1 parent c69cc00 commit e944545
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/npctrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
}
Expand Down

0 comments on commit e944545

Please sign in to comment.