Skip to content

Commit

Permalink
Simplify right clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
terrarier2111 committed Mar 18, 2024
1 parent ad80ced commit ae560f1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/inventory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,8 @@ impl InventoryContext {
(None, Some(mut item)) => {
if !left && item.stack.count > 1 {
let mut cursor = item.clone();
// TODO: this is a stable version of: div_ceil(2) - once this is stabilized, use it instead
cursor.stack.count =
(item.stack.count / 2) + (item.stack.count % 2);
item.stack.count -= cursor.stack.count;
item.stack.count /= 2;
cursor.stack.count -= item.stack.count;
(Some(cursor), Some(item))
} else {
(Some(item), None)
Expand Down

0 comments on commit ae560f1

Please sign in to comment.