Ver Fonte

InputEventJoypadMotion::set_axis - reject invalid axis

LATRio há 3 anos atrás
pai
commit
41c1cfe28e
1 ficheiros alterados com 2 adições e 0 exclusões
  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();
 }