summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-03-07 09:32:17 +0100
committerGitHub <noreply@github.com>2020-03-07 09:32:17 +0100
commit8cb6d5daa4e41443d658265379b6079d8a087b41 (patch)
treed428272dcd1536984990296b738eee88740cdd39
parentb9f2f77dba00810ed83a4512bab9cf652c2627a0 (diff)
parent0ca17116815176a17e1849c261514eb32347b81a (diff)
Merge pull request #36873 from BastiaanOlij/arvr_controller_button_is_bool
ARVRController.is_button_pressed requires to return a boolean
-rw-r--r--doc/classes/ARVRController.xml2
-rw-r--r--scene/3d/arvr_nodes.cpp2
-rw-r--r--scene/3d/arvr_nodes.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/doc/classes/ARVRController.xml b/doc/classes/ARVRController.xml
index e485bd6f1a..ebae25feb7 100644
--- a/doc/classes/ARVRController.xml
+++ b/doc/classes/ARVRController.xml
@@ -57,7 +57,7 @@
</description>
</method>
<method name="is_button_pressed" qualifiers="const">
- <return type="int">
+ <return type="bool">
</return>
<argument index="0" name="button" type="int">
</argument>
diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp
index bf85a8bd53..d23e5ffa08 100644
--- a/scene/3d/arvr_nodes.cpp
+++ b/scene/3d/arvr_nodes.cpp
@@ -300,7 +300,7 @@ int ARVRController::get_joystick_id() const {
return tracker->get_joy_id();
};
-int ARVRController::is_button_pressed(int p_button) const {
+bool ARVRController::is_button_pressed(int p_button) const {
int joy_id = get_joystick_id();
if (joy_id == -1) {
return false;
diff --git a/scene/3d/arvr_nodes.h b/scene/3d/arvr_nodes.h
index 44dfda15a6..e968e33c9d 100644
--- a/scene/3d/arvr_nodes.h
+++ b/scene/3d/arvr_nodes.h
@@ -88,7 +88,7 @@ public:
String get_controller_name(void) const;
int get_joystick_id() const;
- int is_button_pressed(int p_button) const;
+ bool is_button_pressed(int p_button) const;
float get_joystick_axis(int p_axis) const;
real_t get_rumble() const;