From 3e2ec577211180689258e66be647a32e205ed718 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 10 Feb 2019 22:14:59 +1100 Subject: [PATCH] remove special behaviour of air with HoldThis packet SetClickDistance 0 does a better job of this anyways --- src/InputHandler.c | 2 +- src/Inventory.c | 3 --- src/Inventory.h | 3 --- src/PacketHandlers.c | 1 - 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/InputHandler.c b/src/InputHandler.c index 04eb490a0..aac9ffa60 100644 --- a/src/InputHandler.c +++ b/src/InputHandler.c @@ -335,7 +335,7 @@ void InputHandler_PickBlocks(bool cooldown, bool left, bool middle, bool right) InputHandler_ButtonStateChanged(MOUSE_MIDDLE, middle); } - if (Gui_GetActiveScreen()->HandlesAllInput || !Inventory.CanUse) return; + if (Gui_GetActiveScreen()->HandlesAllInput) return; if (left) { /* always play delete animations, even if we aren't picking a block */ diff --git a/src/Inventory.c b/src/Inventory.c index ddb601816..052ca5b66 100644 --- a/src/Inventory.c +++ b/src/Inventory.c @@ -18,7 +18,6 @@ bool Inventory_CheckChangeSelected(void) { void Inventory_SetSelectedIndex(int index) { if (!Inventory_CheckChangeSelected()) return; - Inventory.CanUse = true; Inventory.SelectedIndex = index; Event_RaiseVoid(&UserEvents.HeldBlockChanged); } @@ -33,7 +32,6 @@ void Inventory_SetSelectedBlock(BlockID block) { int i; if (!Inventory_CheckChangeSelected()) return; /* Swap with the current, if the new block is already in the hotbar */ - Inventory.CanUse = true; for (i = 0; i < INVENTORY_BLOCKS_PER_HOTBAR; i++) { if (Inventory_Get(i) != block) continue; @@ -105,7 +103,6 @@ void Inventory_Remove(BlockID block) { static void Inventory_Reset(void) { Inventory_ApplyDefaultMapping(); Inventory.CanChangeSelected = true; - Inventory.CanUse = true; } static void Inventory_Init(void) { diff --git a/src/Inventory.h b/src/Inventory.h index c59d13f88..e2aeb8564 100644 --- a/src/Inventory.h +++ b/src/Inventory.h @@ -25,9 +25,6 @@ CC_VAR extern struct _InventoryData { int Offset; /* Whether the user is allowed to change selected/held block. */ bool CanChangeSelected; - /* Whether the user can use the inventory at all. */ - /* NOTE: false prevents the user from deleting/picking/placing blocks. */ - bool CanUse; } Inventory; /* Gets the block at the nth index in the current hotbar. */ diff --git a/src/PacketHandlers.c b/src/PacketHandlers.c index 364ab59a4..a2c413279 100644 --- a/src/PacketHandlers.c +++ b/src/PacketHandlers.c @@ -949,7 +949,6 @@ static void CPE_HoldThis(uint8_t* data) { Inventory.CanChangeSelected = true; Inventory_SetSelectedBlock(block); Inventory.CanChangeSelected = canChange; - Inventory.CanUse = block != BLOCK_AIR; } static void CPE_SetTextHotkey(uint8_t* data) {