mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 19:15:14 -04:00
remove special behaviour of air with HoldThis packet
SetClickDistance 0 does a better job of this anyways
This commit is contained in:
parent
c00eec58fb
commit
3e2ec57721
@ -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 */
|
||||
|
@ -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) {
|
||||
|
@ -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. */
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user