فهرست منبع

Merge pull request #11280 from BastiaanOlij/fix_arvr_joyid

joyid is set to -1, not 0 when no joystick entity has been created
Andreas Haas 8 سال پیش
والد
کامیت
6b729726e0
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      scene/3d/arvr_nodes.cpp

+ 2 - 2
scene/3d/arvr_nodes.cpp

@@ -184,7 +184,7 @@ int ARVRController::get_joystick_id() const {
 
 int ARVRController::is_button_pressed(int p_button) const {
 	int joy_id = get_joystick_id();
-	if (joy_id == 0) {
+	if (joy_id == -1) {
 		return false;
 	};
 
@@ -193,7 +193,7 @@ int ARVRController::is_button_pressed(int p_button) const {
 
 float ARVRController::get_joystick_axis(int p_axis) const {
 	int joy_id = get_joystick_id();
-	if (joy_id == 0) {
+	if (joy_id == -1) {
 		return 0.0;
 	};