Browse Source

InputEventJoypadMotion::set_axis - reject invalid axis

LATRio 3 năm trước cách đây
mục cha
commit
41c1cfe28e
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      core/input/input_event.cpp

+ 2 - 0
core/input/input_event.cpp

@@ -864,6 +864,8 @@ void InputEventMouseMotion::_bind_methods() {
 ///////////////////////////////////
 
 void InputEventJoypadMotion::set_axis(JoyAxis p_axis) {
+	ERR_FAIL_INDEX(p_axis, JOY_AXIS_MAX);
+
 	axis = p_axis;
 	emit_changed();
 }