From 879829c671f38b71be2176eeb0c4ff2cdf9a16a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Reuh=20Fildadut?= Date: Fri, 7 Oct 2022 12:37:28 +0900 Subject: [PATCH] input: neutralize also neutralize the children --- input/input.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/input/input.lua b/input/input.lua index ade6652..ce56741 100644 --- a/input/input.lua +++ b/input/input.lua @@ -711,7 +711,7 @@ input_mt = { end end, - --- Set the state of this input to a neutral position (i.e. value = 0 for every dimension). + --- Set the state of this input and its children to a neutral position (i.e. value = 0 for every dimension). neutralize = function(self) local zeros = { 0 } for i=2, self._dimension do zeros[i] = 0 end @@ -721,6 +721,9 @@ input_mt = { self._value[i] = 0 self._prevValue[i] = 0 end + for _, c in ipairs(self.children) do + c:neutralize() + end end, --- Set the joystick associated with this input.