mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 03:55:19 -04:00
Fix spamming G (without having changed held block index) causing arm to constantly move down again and again (Thanks Kingoscargames1)
This commit is contained in:
parent
5d8c511472
commit
345438d913
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user