mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 21:52:51 +00:00
Ensure grid index is valid before trying to change value.
This commit is contained in:
parent
bf37ab52b3
commit
f98acd5cfb
@ -614,7 +614,7 @@ public:
|
||||
|
||||
const Ref<InputEventMouseButton> mb = p_ev;
|
||||
|
||||
if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
|
||||
if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed() && hovered_index > 0) {
|
||||
// Toggle the flag.
|
||||
// We base our choice on the hovered flag, so that it always matches the hovered flag.
|
||||
if (value & (1 << hovered_index)) {
|
||||
|
Loading…
Reference in New Issue
Block a user