From 345438d913cb2dabebaa80fc87d5817c02daff8b Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 23 Dec 2017 22:08:43 +1100 Subject: [PATCH] Fix spamming G (without having changed held block index) causing arm to constantly move down again and again (Thanks Kingoscargames1) --- ClassicalSharp/Mode/Creative.cs | 2 +- src/Client/GameMode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ClassicalSharp/Mode/Creative.cs b/ClassicalSharp/Mode/Creative.cs index 93bcb8ec5..28339f246 100644 --- a/ClassicalSharp/Mode/Creative.cs +++ b/ClassicalSharp/Mode/Creative.cs @@ -22,7 +22,7 @@ namespace ClassicalSharp.Mode { return true; } else if (key == game.Input.Keys[KeyBind.DropBlock] && !game.ClassicMode) { Inventory inv = game.Inventory; - if (inv.CanChangeSelected()) { + if (inv.CanChangeSelected() && inv.Selected != Block.Air) { // Don't assign Selected directly, because we don't want held block // switching positions if they already have air in their inventory hotbar. inv[inv.SelectedIndex] = Block.Air; diff --git a/src/Client/GameMode.c b/src/Client/GameMode.c index fc76a88f8..1e1624cd4 100644 --- a/src/Client/GameMode.c +++ b/src/Client/GameMode.c @@ -26,7 +26,7 @@ bool GameMode_HandlesKeyDown(Key key) { Gui_SetNewScreen(screen); return true; } else if (key == KeyBind_Get(KeyBind_DropBlock) && !Game_ClassicMode) { - if (Inventory_CanChangeSelected()) { + if (Inventory_CanChangeSelected() && Inventory_SelectedBlock != BLOCK_AIR) { /* Don't assign SelectedIndex directly, because we don't want held block switching positions if they already have air in their inventory hotbar. */ Inventory_Set(Inventory_SelectedIndex, BLOCK_AIR);