Skip to content

Commit

Permalink
fix modified slots bit check
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 committed Jan 20, 2023
1 parent ba08bf1 commit 5e150c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/valence_new/src/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub(crate) fn update_player_inventories(
} else {
// send the modified slots
let state_id = client.inventory_state_id.0;
if inventory.modified ^ client.inventory_slots_modified != 0 {
if inventory.modified & !client.inventory_slots_modified != 0 {
client.inventory_state_id += 1;
for (i, slot) in inventory.slots.iter().enumerate() {
if (inventory.modified >> i) & 1 == 1 {
Expand Down Expand Up @@ -386,7 +386,7 @@ pub(crate) fn update_open_inventories(
// send the modified slots
let window_id = client.window_id as i8;
let state_id = client.inventory_state_id.0;
if inventory.modified ^ open_inventory.client_modified != 0 {
if inventory.modified & !open_inventory.client_modified != 0 {
client.inventory_state_id += 1;
for (i, slot) in inventory.slots.iter().enumerate() {
if (inventory.modified >> i) & 1 == 1 {
Expand Down

0 comments on commit 5e150c7

Please sign in to comment.