Explorar el Código

InputEventJoypadMotion::set_axis - reject invalid axis

LATRio hace 4 años
padre
commit
41c1cfe28e
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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();
 }