mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-09 04:32:27 -04:00
Fix[controls]: fix the hotbar out-of-bounds crashes
This commit is contained in:
parent
68254e0c8e
commit
cbaebec12a
@ -94,7 +94,8 @@ public class HotbarView extends View implements MCOptionUtils.MCOptionListener,
|
||||
else mDropGesture.submit();
|
||||
// Determine the hotbar slot
|
||||
float x = event.getX();
|
||||
if(x < 0 || x > mWidth) {
|
||||
// Ignore positions equal to mWidth because they would translate into an out-of-bounds hotbar index
|
||||
if(x < 0 || x >= mWidth) {
|
||||
// If out of bounds, cancel the hotbar gesture to avoid dropping items on last hotbar slots
|
||||
mDropGesture.cancel();
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user